Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-25 Thread Jani Taskinen

This was fun thread to read: Blind leading blind..
Fix after fix to fix something that isn't broken. :)

Pierre: There are other OSes than win32 and they're priority #1, 
Winblows is the last. Please don't clutter the code with this win32 
mania of yours.



--Jani


Arnaud Le Blanc wrote:

Hi,

On Saturday 23 August 2008 21:58:53 Pierre Joye wrote:

On Sat, Aug 23, 2008 at 9:34 PM, Arnaud Le Blanc [EMAIL PROTECTED] wrote:

Yes, but I was speaking about this line:
typedef uint32_t u_int32_t;

Right :)

Do you have the time to give the inline a try? 


It works.

It would be nice to standardize it in php_config and config.w32.h as it can be 

used in other places as well.

Yes. IMO the best solution is to use AC_C_INLINE and an equivalent for Windows 
who defines inline so that we can always expect it to be defined.



Cheers,
--
Pierre

http://blog.thepimp.net | http://www.libgd.org



Regards,

Arnaud





--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-25 Thread Pierre Joye
hi,

On Mon, Aug 25, 2008 at 2:52 PM, Jani Taskinen [EMAIL PROTECTED] wrote:
 This was fun thread to read: Blind leading blind..
 Fix after fix to fix something that isn't broken. :)

 Pierre: There are other OSes than win32 and they're priority #1, Winblows is
 the last. Please don't clutter the code with this win32 mania of yours.

In case you miss it, what I'm trying to achieve is exactly that, avoid
platform specific tests.

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-23 Thread Pierre Joye
hi Arnaud,

this commit breaks the windows build. Parts of it makes little sense, see below:

On Sat, Aug 23, 2008 at 3:57 PM, Arnaud Le Blanc [EMAIL PROTECTED] wrote:
 lbarnaudSat Aug 23 13:57:02 2008 UTC

  Modified files:
/php-src/ext/standard   config.m4 crypt_freesec.c crypt_freesec.h
  Log:
  Fix build on solaris


 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/config.m4?r1=1.89r2=1.90diff_format=u
 Index: php-src/ext/standard/config.m4
 diff -u php-src/ext/standard/config.m4:1.89 
 php-src/ext/standard/config.m4:1.90
 --- php-src/ext/standard/config.m4:1.89 Mon Jul 28 11:34:53 2008
 +++ php-src/ext/standard/config.m4  Sat Aug 23 13:57:01 2008
 @@ -1,4 +1,4 @@
 -dnl $Id: config.m4,v 1.89 2008/07/28 11:34:53 pajoye Exp $ -*- autoconf -*-
 +dnl $Id: config.m4,v 1.90 2008/08/23 13:57:01 lbarnaud Exp $ -*- autoconf -*-

  divert(3)dnl

 @@ -464,6 +464,27 @@
  fi

  dnl
 +dnl Check for u_int32_t
 +dnl
 +AC_CACHE_CHECK([for u_int32_t], [ac_cv_type_u_int32_t],[
 +AC_TRY_COMPILE([
 +#ifdef HAVE_SYS_TYPES_H
 +# include sys/types.h
 +#endif
 +],[
 +int __tmp__() { u_int32_t a; }
 +],[
 +  ac_cv_type_u_int32_t=yes
 +],[
 +  ac_cv_type_u_int32_t=no
 +])])
 +if test $ac_cv_type_u_int32_t = yes; then
 +  AC_DEFINE([HAVE_U_INT32_T], 1, [Define if your system has u_int32_t in 
 sys/types.h])
 +fi
 +
 +AC_C_INLINE
 +
 +dnl
  dnl Setup extension sources
  dnl
  PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c 
 crc32.c crypt.c \
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/crypt_freesec.c?r1=1.2r2=1.3diff_format=u
 Index: php-src/ext/standard/crypt_freesec.c
 diff -u php-src/ext/standard/crypt_freesec.c:1.2 
 php-src/ext/standard/crypt_freesec.c:1.3
 --- php-src/ext/standard/crypt_freesec.c:1.2Mon Jul 28 16:32:48 2008
 +++ php-src/ext/standard/crypt_freesec.cSat Aug 23 13:57:01 2008
 @@ -1,5 +1,5 @@
  /*
 -  $Id: crypt_freesec.c,v 1.2 2008/07/28 16:32:48 pajoye Exp $
 +  $Id: crypt_freesec.c,v 1.3 2008/08/23 13:57:01 lbarnaud Exp $
  */
  /*
  * This version is derived from the original implementation of FreeSec
 @@ -40,7 +40,7 @@
  * SUCH DAMAGE.
  *
  * $Owl: Owl/packages/glibc/crypt_freesec.c,v 1.4 2005/11/16 13:08:32 
 solar Exp $
 - * $Id: crypt_freesec.c,v 1.2 2008/07/28 16:32:48 pajoye Exp $
 + * $Id: crypt_freesec.c,v 1.3 2008/08/23 13:57:01 lbarnaud Exp $
  *
  * This is an original implementation of the DES and the crypt(3) interfaces
  * by David Burren davidb at werj.com.au.
 @@ -184,7 +184,7 @@
  static u_int32_t key_perm_maskl[8][128], key_perm_maskr[8][128];
  static u_int32_t comp_maskl[8][128], comp_maskr[8][128];

 -__inline int
 +static inline int

__inline is known on gcc and windows, adding a define for solaris
sounds more appropriate.

 +#include php_config.h

that breaks on win.

  #if PHP_WIN32
  # include win32/php_stdint.h
  #elif HAVE_STDINT_H
  # include stdint.h
  #endif
 +#if !PHP_WIN32

little #else instead? :)

 +# ifndef HAVE_U_INT32_T
 +   typedef uint32_t u_int32_t;
 +# endif
 +#endif

I don't understand this part. If  HAVE_U_INT32_T is not defined, you
still use u_int32_t?

I will commit the fixes for windows soonish but the last problem seems
to be wrong (sorry but I don't have any solaris to test).

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-23 Thread Arnaud Le Blanc
Hi,

On Saturday 23 August 2008 18:50:37 Pierre Joye wrote:
  -__inline int
  +static inline int
 
 __inline is known on gcc and windows, adding a define for solaris
 sounds more appropriate.

The commit adds AC_C_INLINE in config.m4, which defines inline appropriatly 
to 
__inline or __inline__ if the compiler does not know the inline keyword.

Basically it does what you added in your commit, but without forcing inlining, 
and unlike a test against some known compiler macros, this will work on all 
compilers by checking what they actually support.
For instance your code will check only GCC and the MS compiler, and the last 
#else may miss the fact that the compiler actually supported __inline or 
__inline__.

For static before inline, it avoids a problem with the Sun compiler 
(without static the compiler references the function but does not actually 
outputs it).

 
  +#include php_config.h
 
 that breaks on win.

Sorry

 
   #if PHP_WIN32
   # include win32/php_stdint.h
   #elif HAVE_STDINT_H
   # include stdint.h
   #endif
  +#if !PHP_WIN32
 
 little #else instead? :)
 
  +# ifndef HAVE_U_INT32_T
  +   typedef uint32_t u_int32_t;
  +# endif
  +#endif
 
 I don't understand this part. If  HAVE_U_INT32_T is not defined, you
 still use u_int32_t?

If HAVE_U_INT32_T is not defined that means that u_int32_t is not defined.
So I define u_int32_t it to uint32_t. This makes sense for me.

 
 I will commit the fixes for windows soonish but the last problem seems
 to be wrong (sorry but I don't have any solaris to test).
 
 Cheers,
 -- 
 Pierre
 
 http://blog.thepimp.net | http://www.libgd.org
 

Regards,

Arnaud


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-23 Thread Pierre Joye
hi,

On Sat, Aug 23, 2008 at 7:57 PM, Arnaud Le Blanc [EMAIL PROTECTED] wrote:

 The commit adds AC_C_INLINE in config.m4, which defines inline appropriatly 
 to
 __inline or __inline__ if the compiler does not know the inline keyword.

 Basically it does what you added in your commit, but without forcing inlining,

The latter is an optimization, I should have added it in my commit
msg. By the way, config.m4 is unix only and is completely useless on
windows.

 and unlike a test against some known compiler macros, this will work on all
 compilers by checking what they actually support.

Except windows (and certainly other).

 For instance your code will check only GCC and the MS compiler, and the last
 #else may miss the fact that the compiler actually supported __inline or
 __inline__.

 For static before inline, it avoids a problem with the Sun compiler
 (without static the compiler references the function but does not actually
 outputs it).

So please apply the correct fix, but keep the windows linux and
windows build safe. That certainly means to add what you need in the
src or add a portable way to use inline (like in zend, which is where
I took the #ifdef). That would be actually the best solution (in
php_config.h and config.w32.h).

  +# ifndef HAVE_U_INT32_T
  +   typedef uint32_t u_int32_t;
  +# endif
  +#endif

 I don't understand this part. If  HAVE_U_INT32_T is not defined, you
 still use u_int32_t?

 If HAVE_U_INT32_T is not defined that means that u_int32_t is not defined.
 So I define u_int32_t it to uint32_t. This makes sense for me.

It defines unint32_t not u_int32_t. The define should be HAVE_UINT32_T
if what you test is uint32_t.

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-23 Thread Arnaud Le Blanc
Hi,

On Saturday 23 August 2008 20:16:16 Pierre Joye wrote:
 hi,
 
   +# ifndef HAVE_U_INT32_T
   +   typedef uint32_t u_int32_t;
   +# endif
   +#endif
 
  I don't understand this part. If  HAVE_U_INT32_T is not defined, you
  still use u_int32_t?
 
  If HAVE_U_INT32_T is not defined that means that u_int32_t is not defined.
  So I define u_int32_t it to uint32_t. This makes sense for me.
 
 It defines unint32_t not u_int32_t. The define should be HAVE_UINT32_T
 if what you test is uint32_t.

This is a typedef, not a #define ;)

 
 Cheers,
 -- 
 Pierre
 
 http://blog.thepimp.net | http://www.libgd.org
 

Regards,

Arnaud

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-23 Thread Pierre Joye
On Sat, Aug 23, 2008 at 9:15 PM, Arnaud Le Blanc [EMAIL PROTECTED] wrote:
 Hi,

 On Saturday 23 August 2008 20:16:16 Pierre Joye wrote:
 hi,

   +# ifndef HAVE_U_INT32_T
   +   typedef uint32_t u_int32_t;
   +# endif
   +#endif
 
  I don't understand this part. If  HAVE_U_INT32_T is not defined, you
  still use u_int32_t?
 
  If HAVE_U_INT32_T is not defined that means that u_int32_t is not defined.
  So I define u_int32_t it to uint32_t. This makes sense for me.

 It defines unint32_t not u_int32_t. The define should be HAVE_UINT32_T
 if what you test is uint32_t.

 This is a typedef, not a #define ;)

 HAVE_U_INT32_T is a define  or a /D (or whatever uses other compilers)  :-)

-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-23 Thread Arnaud Le Blanc
On Saturday 23 August 2008 21:21:16 Pierre Joye wrote:
 On Sat, Aug 23, 2008 at 9:15 PM, Arnaud Le Blanc [EMAIL PROTECTED] wrote:
  Hi,
 
  On Saturday 23 August 2008 20:16:16 Pierre Joye wrote:
  hi,
 
+# ifndef HAVE_U_INT32_T
+   typedef uint32_t u_int32_t;
+# endif
+#endif
  
   I don't understand this part. If  HAVE_U_INT32_T is not defined, you
   still use u_int32_t?
  
   If HAVE_U_INT32_T is not defined that means that u_int32_t is not 
defined.
   So I define u_int32_t it to uint32_t. This makes sense for me.
 
  It defines unint32_t not u_int32_t. The define should be HAVE_UINT32_T
  if what you test is uint32_t.
 
  This is a typedef, not a #define ;)
 
  HAVE_U_INT32_T is a define  or a /D (or whatever uses other compilers)  :-)

Yes, but I was speaking about this line:
typedef uint32_t u_int32_t;

 
 -- 
 Pierre
 
 http://blog.thepimp.net | http://www.libgd.org
 

Regards,

Arnaud


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-23 Thread Pierre Joye
On Sat, Aug 23, 2008 at 9:34 PM, Arnaud Le Blanc [EMAIL PROTECTED] wrote:
 Yes, but I was speaking about this line:
 typedef uint32_t u_int32_t;

Right :)

Do you have the time to give the inline a try? It would be nice to
standardize it in php_config and config.w32.h as it can be used in
other places as well.

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h

2008-08-23 Thread Arnaud Le Blanc
Hi,

On Saturday 23 August 2008 21:58:53 Pierre Joye wrote:
 On Sat, Aug 23, 2008 at 9:34 PM, Arnaud Le Blanc [EMAIL PROTECTED] wrote:
  Yes, but I was speaking about this line:
  typedef uint32_t u_int32_t;
 
 Right :)
 
 Do you have the time to give the inline a try? 

It works.

 It would be nice to standardize it in php_config and config.w32.h as it can 
 be 
used in other places as well.

Yes. IMO the best solution is to use AC_C_INLINE and an equivalent for Windows 
who defines inline so that we can always expect it to be defined.

 
 Cheers,
 -- 
 Pierre
 
 http://blog.thepimp.net | http://www.libgd.org
 

Regards,

Arnaud


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4

2004-11-10 Thread Joe Orton
On Tue, Nov 09, 2004 at 08:39:53PM +0100, Derick Rethans wrote:
 On Tue, 9 Nov 2004, Joe Orton wrote:
 
  jorton  Tue Nov  9 10:58:17 2004 EDT
 
Modified files:
  /php-src/ext/standard   config.m4
Log:
Make the rounding fuzz check work again with gcc 3.3 and later,
fixing the bug24142 test.
 
 Doesn't this need to be fixed in PHP_5_0 and PHP_4_3 either?

Probably, but I'd rather hear so from someone who really understands
this code in case I'm missing something fundamental.

 And can it have something to do with bug #30729?

Again no idea really, sorry!

joe

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard config.m4

2004-11-09 Thread Derick Rethans
On Tue, 9 Nov 2004, Joe Orton wrote:

 jortonTue Nov  9 10:58:17 2004 EDT

   Modified files:
 /php-src/ext/standard config.m4
   Log:
   Make the rounding fuzz check work again with gcc 3.3 and later,
   fixing the bug24142 test.

Doesn't this need to be fixed in PHP_5_0 and PHP_4_3 either? And can it
have something to do with bug #30729?

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php