[PHP-CVS] cvs: php-src /ext/standard config.m4
janiMon Aug 25 12:14:48 2008 UTC Modified files: /php-src/ext/standard config.m4 Log: - Nuke duplicate macro call http://cvs.php.net/viewvc.cgi/php-src/ext/standard/config.m4?r1=1.90r2=1.91diff_format=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.90 php-src/ext/standard/config.m4:1.91 --- php-src/ext/standard/config.m4:1.90 Sat Aug 23 13:57:01 2008 +++ php-src/ext/standard/config.m4 Mon Aug 25 12:14:48 2008 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.90 2008/08/23 13:57:01 lbarnaud Exp $ -*- autoconf -*- +dnl $Id: config.m4,v 1.91 2008/08/25 12:14:48 jani Exp $ -*- autoconf -*- divert(3)dnl @@ -482,8 +482,6 @@ 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 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
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
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
[PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h
janiMon Aug 25 13:42:47 2008 UTC Modified files: /php-src/ext/standard config.m4 crypt_freesec.c crypt_freesec.h Log: - Nuke unncessary checks already done elsewhere (ZEND) - Use the correct type header files if available. (win32 does what it does) - inline definition is in php_config.h, so include it always. http://cvs.php.net/viewvc.cgi/php-src/ext/standard/config.m4?r1=1.91r2=1.92diff_format=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.91 php-src/ext/standard/config.m4:1.92 --- php-src/ext/standard/config.m4:1.91 Mon Aug 25 12:14:48 2008 +++ php-src/ext/standard/config.m4 Mon Aug 25 13:42:46 2008 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.91 2008/08/25 12:14:48 jani Exp $ -*- autoconf -*- +dnl $Id: config.m4,v 1.92 2008/08/25 13:42:46 jani Exp $ -*- autoconf -*- divert(3)dnl @@ -464,25 +464,6 @@ 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 - -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.4r2=1.5diff_format=u Index: php-src/ext/standard/crypt_freesec.c diff -u php-src/ext/standard/crypt_freesec.c:1.4 php-src/ext/standard/crypt_freesec.c:1.5 --- php-src/ext/standard/crypt_freesec.c:1.4Sat Aug 23 17:08:30 2008 +++ php-src/ext/standard/crypt_freesec.cMon Aug 25 13:42:46 2008 @@ -1,5 +1,5 @@ /* - $Id: crypt_freesec.c,v 1.4 2008/08/23 17:08:30 pajoye Exp $ + $Id: crypt_freesec.c,v 1.5 2008/08/25 13:42:46 jani 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.4 2008/08/23 17:08:30 pajoye Exp $ + * $Id: crypt_freesec.c,v 1.5 2008/08/25 13:42:46 jani Exp $ * * This is an original implementation of the DES and the crypt(3) interfaces * by David Burren davidb at werj.com.au. @@ -65,24 +65,6 @@ #include sys/types.h #include string.h -#ifdef TEST -#include stdio.h -#endif - - -#if defined(__GNUC__) -# ifdef inline -# undef inline -# endif -# define inline inline __attribute__((always_inline)) -#elif defined(_MSC_VER) -# define inline __forceinline -#else -# ifndef inline -# define inline -# endif -#endif - #include crypt_freesec.h #define _PASSWORD_EFMT1 '_' @@ -172,7 +154,7 @@ 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25 }; -static u_int32_t bits32[32] = +static uint32_t bits32[32] = { 0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100, @@ -192,11 +174,11 @@ /* 0123456789012345678901234567890123456789012345678901234567890123 */ static u_char m_sbox[4][4096]; -static u_int32_t psbox[4][256]; -static u_int32_t ip_maskl[8][256], ip_maskr[8][256]; -static u_int32_t fp_maskl[8][256], fp_maskr[8][256]; -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]; +static uint32_t psbox[4][256]; +static uint32_t ip_maskl[8][256], ip_maskr[8][256]; +static uint32_t fp_maskl[8][256], fp_maskr[8][256]; +static uint32_t key_perm_maskl[8][128], key_perm_maskr[8][128]; +static uint32_t comp_maskl[8][128], comp_maskr[8][128]; static inline int ascii_to_bin(char ch) @@ -220,8 +202,8 @@ _crypt_extended_init(void) { int i, j, b, k, inbit, obit; - u_int32_t *p, *il, *ir, *fl, *fr; - u_int32_t *bits28, *bits24; + uint32_t *p, *il, *ir, *fl, *fr; + uint32_t *bits28, *bits24; u_char inv_key_perm[64]; u_char u_key_perm[56]; u_char inv_comp_perm[56]; @@ -359,9 +341,9 @@ } static void -setup_salt(u_int32_t salt, struct php_crypt_extended_data *data) +setup_salt(uint32_t salt, struct php_crypt_extended_data *data) { - u_int32_t obit, saltbit, saltbits; + uint32_tobit, saltbit, saltbits; int i; if (salt == data-old_salt) @@ -383,19 +365,19 @@ static int des_setkey(const char *key, struct php_crypt_extended_data *data) { - u_int32_t k0, k1, rawkey0, rawkey1; + uint32_tk0, k1, rawkey0, rawkey1; int shifts, round; rawkey0 = - (u_int32_t)(u_char)key[3] | - ((u_int32_t)(u_char)key[2] 8) | - ((u_int32_t)(u_char)key[1] 16) | - ((u_int32_t)(u_char)key[0] 24); + (uint32_t)(u_char)key[3] | +
Re: [PHP-CVS] cvs: php-src /ext/standard config.m4 crypt_freesec.c crypt_freesec.h
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
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
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
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
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
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
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
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
[PHP-CVS] cvs: php-src /ext/standard config.m4
janiWed Jul 11 11:55:46 2007 UTC Modified files: /php-src/ext/standard config.m4 Log: - Nuke extra AC_MSG_CHECKING http://cvs.php.net/viewvc.cgi/php-src/ext/standard/config.m4?r1=1.85r2=1.86diff_format=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.85 php-src/ext/standard/config.m4:1.86 --- php-src/ext/standard/config.m4:1.85 Wed Jul 11 10:27:16 2007 +++ php-src/ext/standard/config.m4 Wed Jul 11 11:55:46 2007 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.85 2007/07/11 10:27:16 jani Exp $ -*- autoconf -*- +dnl $Id: config.m4,v 1.86 2007/07/11 11:55:46 jani Exp $ -*- autoconf -*- divert(3)dnl @@ -210,7 +210,7 @@ dnl dnl Check for regex library type dnl -PHP_ARG_WITH(regex, for selected regex library type, +PHP_ARG_WITH(regex,, [ --with-regex=TYPE regex library type: system, apache, php. [TYPE=php] WARNING: Do NOT use unless you know what you are doing!], php, no) @@ -230,7 +230,7 @@ ;; *) REGEX_TYPE=php -AC_MSG_WARN(Invalid regex library type. Using default value: php) +AC_MSG_WARN(Invalid regex library type selected. Using default value: php) ;; esac -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard config.m4 datetime.c
tony2001Thu Aug 24 11:05:38 2006 UTC Modified files: /php-src/ext/standard config.m4 datetime.c Log: this fixes segfault in strptime() on 64bit Linuxes, caused by the missing declaration unfortunately defining _XOPEN_SOURCE breaks the build (some odd dependencies in glibc headers) and this seems to be the best solution http://cvs.php.net/viewvc.cgi/php-src/ext/standard/config.m4?r1=1.83r2=1.84diff_format=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.83 php-src/ext/standard/config.m4:1.84 --- php-src/ext/standard/config.m4:1.83 Wed Jan 4 12:57:04 2006 +++ php-src/ext/standard/config.m4 Thu Aug 24 11:05:38 2006 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.83 2006/01/04 12:57:04 derick Exp $ -*- autoconf -*- +dnl $Id: config.m4,v 1.84 2006/08/24 11:05:38 tony2001 Exp $ -*- autoconf -*- divert(3)dnl @@ -477,6 +477,26 @@ AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN]) fi +AC_CACHE_CHECK(whether strptime() declaration fails, ac_cv_strptime_decl_fails,[ + AC_TRY_COMPILE([ +#include time.h + ],[ +#ifndef HAVE_STRPTIME +#error no strptime() on this platform +#else +/* use invalid strptime() declaration to see if it fails to compile */ +int strptime(const char *s, const char *format, struct tm *tm); +#endif + ],[ + ac_cv_strptime_decl_fails=no + ],[ + ac_cv_strptime_decl_fails=yes + ]) +]) +if test $ac_cv_strptime_decl_fails = yes; then + AC_DEFINE([HAVE_STRPTIME_DECL_FAILS], 1, [whether strptime() declaration fails]) +fi + PHP_CHECK_I18N_FUNCS 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/datetime.c?r1=1.138r2=1.139diff_format=u Index: php-src/ext/standard/datetime.c diff -u php-src/ext/standard/datetime.c:1.138 php-src/ext/standard/datetime.c:1.139 --- php-src/ext/standard/datetime.c:1.138 Sun Aug 20 18:20:59 2006 +++ php-src/ext/standard/datetime.c Thu Aug 24 11:05:38 2006 @@ -18,11 +18,7 @@ +--+ */ -/* $Id: datetime.c,v 1.138 2006/08/20 18:20:59 iliaa Exp $ */ - -#if HAVE_STRPTIME -#define _XOPEN_SOURCE -#endif +/* $Id: datetime.c,v 1.139 2006/08/24 11:05:38 tony2001 Exp $ */ #include php.h #include zend_operators.h @@ -85,6 +81,10 @@ #if HAVE_STRPTIME +#ifndef HAVE_STRPTIME_DECL_FAILS +char *strptime(const char *s, const char *format, struct tm *tm); +#endif + /* {{{ proto string strptime(string timestamp, string format) Parse a time/date generated with strftime() */ PHP_FUNCTION(strptime) -- 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
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
[PHP-CVS] cvs: php-src /ext/standard config.m4
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. http://cvs.php.net/diff.php/php-src/ext/standard/config.m4?r1=1.76r2=1.77ty=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.76 php-src/ext/standard/config.m4:1.77 --- php-src/ext/standard/config.m4:1.76 Tue Sep 28 16:42:56 2004 +++ php-src/ext/standard/config.m4 Tue Nov 9 10:58:16 2004 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.76 2004/09/28 20:42:56 sniper Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.77 2004/11/09 15:58:16 jorton Exp $ -*- autoconf -*- divert(3)dnl @@ -275,8 +275,12 @@ AC_MSG_CHECKING([whether rounding works as expected]) AC_TRY_RUN([ #include math.h + /* keep this out-of-line to prevent use of gcc inline floor() */ + double somefn(double n) { +return floor(n*pow(10,2) + 0.5); + } int main() { -return floor(0.045*pow(10,2) + 0.5)/10.0 != 0.5; +return somefn(0.045)/10.0 != 0.5; } ],[ PHP_ROUND_FUZZ=0.5 -- 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
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
[PHP-CVS] cvs: php-src /ext/standard config.m4
sniper Tue Sep 28 16:42:56 2004 EDT Modified files: /php-src/ext/standard config.m4 Log: MFB: - Fixed bug #30205 (Missing unistd.h in crypt() configure test). http://cvs.php.net/diff.php/php-src/ext/standard/config.m4?r1=1.75r2=1.76ty=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.75 php-src/ext/standard/config.m4:1.76 --- php-src/ext/standard/config.m4:1.75 Mon May 10 03:23:38 2004 +++ php-src/ext/standard/config.m4 Tue Sep 28 16:42:56 2004 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.75 2004/05/10 07:23:38 helly Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.76 2004/09/28 20:42:56 sniper Exp $ -*- sh -*- divert(3)dnl @@ -67,6 +67,10 @@ AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[ AC_TRY_RUN([ +#if HAVE_UNISTD_H +#include unistd.h +#endif + #if HAVE_CRYPT_H #include crypt.h #endif @@ -94,6 +98,10 @@ AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[ AC_TRY_RUN([ +#if HAVE_UNISTD_H +#include unistd.h +#endif + #if HAVE_CRYPT_H #include crypt.h #endif @@ -121,6 +129,10 @@ AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[ AC_TRY_RUN([ +#if HAVE_UNISTD_H +#include unistd.h +#endif + #if HAVE_CRYPT_H #include crypt.h #endif @@ -160,6 +172,10 @@ AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[ AC_TRY_RUN([ +#if HAVE_UNISTD_H +#include unistd.h +#endif + #if HAVE_CRYPT_H #include crypt.h #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard config.m4
helly Sun Apr 4 08:31:13 2004 EDT Modified files: /php-src/ext/standard config.m4 Log: Add a comment why it is in http://cvs.php.net/diff.php/php-src/ext/standard/config.m4?r1=1.73r2=1.74ty=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.73 php-src/ext/standard/config.m4:1.74 --- php-src/ext/standard/config.m4:1.73 Sat Apr 3 11:38:10 2004 +++ php-src/ext/standard/config.m4 Sun Apr 4 08:31:12 2004 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.73 2004/04/03 16:38:10 abies Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.74 2004/04/04 12:31:12 helly Exp $ -*- sh -*- divert(3)dnl @@ -416,6 +416,7 @@ int main(int argc, char** argv) { #if defined(__sparc__) !(__GNUC__ = 3) + /* prevent bug #27830 */ return 1; #else return zend_isinf(HUGE_VAL) zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard config.m4
abies Sat Apr 3 11:38:11 2004 EDT Modified files: /php-src/ext/standard config.m4 Log: That should do it http://cvs.php.net/diff.php/php-src/ext/standard/config.m4?r1=1.72r2=1.73ty=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.72 php-src/ext/standard/config.m4:1.73 --- php-src/ext/standard/config.m4:1.72 Sat Apr 3 05:42:42 2004 +++ php-src/ext/standard/config.m4 Sat Apr 3 11:38:10 2004 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.72 2004/04/03 10:42:42 abies Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.73 2004/04/03 16:38:10 abies Exp $ -*- sh -*- divert(3)dnl @@ -413,16 +413,13 @@ #define zend_isnan(a) 0 #endif -double hv(int i) -{ - /* avoid inlining */ - if (i) return hv(i-1); - else return HUGE_VAL; -} - int main(int argc, char** argv) { - return zend_isinf(hv(3)) zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1; +#if defined(__sparc__) !(__GNUC__ = 3) + return 1; +#else + return zend_isinf(HUGE_VAL) zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1; +#endif } ],[ ac_cv_huge_val_nan=yes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard config.m4
moriyoshi Sat Oct 4 08:23:12 2003 EDT Modified files: /php-src/ext/standard config.m4 Log: Fix autoconf(2.13) build Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.65 php-src/ext/standard/config.m4:1.66 --- php-src/ext/standard/config.m4:1.65 Fri Oct 3 22:51:19 2003 +++ php-src/ext/standard/config.m4 Sat Oct 4 08:23:11 2003 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.65 2003/10/04 02:51:19 moriyoshi Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.66 2003/10/04 12:23:11 moriyoshi Exp $ -*- sh -*- divert(3)dnl @@ -297,18 +297,36 @@ PHP_CHECK_FUNC(dn_expand, resolv, bind, socket) dnl already done PHP_CHECK_FUNC(dn_skipname, resolv, bind, socket) -AC_CHECK_HEADERS([wchar.h]) -AC_CHECK_FUNCS([mblen]) -AC_CHECK_FUNCS([mbrlen mbsinit],,,[ +dnl +dnl Check for i18n capabilities +dnl +AC_DEFUN([PHP_CHECK_I18N_FUNCS],[ + AC_CHECK_HEADERS([wchar.h]) + AC_CHECK_FUNCS([mblen]) + AC_CHECK_FUNCS([mbrlen mbsinit],,,[ #ifdef HAVE_WCHAR_H # include wchar.h #endif -]) -AC_CHECK_TYPES([mbstate_t],,,[ + ]) + AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t],[ +AC_TRY_COMPILE([ #ifdef HAVE_WCHAR_H # include wchar.h #endif +],[ +int __tmp__() { mbstate_t a; } +],[ + ac_cv_type_mbstate_t=yes +],[ + ac_cv_type_mbstate_t=no +]) + ]) + if test $ac_cv_type_mbstate_t = yes; then +AC_DEFINE([HAVE_MBSTATE_T], 1, [Define if your system has mbstate_t in wchar.h]) + fi ]) + +PHP_CHECK_I18N_FUNCS PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \ cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard config.m4 math.c
helly Fri Aug 8 21:12:41 2003 EDT Modified files: /php-src/ext/standard config.m4 math.c Log: Bugfix #24142, part 2 Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.62 php-src/ext/standard/config.m4:1.63 --- php-src/ext/standard/config.m4:1.62 Mon Jun 30 12:33:50 2003 +++ php-src/ext/standard/config.m4 Fri Aug 8 21:12:41 2003 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.62 2003/06/30 16:33:50 sniper Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.63 2003/08/09 01:12:41 helly Exp $ -*- sh -*- divert(3)dnl @@ -252,6 +252,27 @@ fi ]) + +dnl +dnl round fuzz +dnl +AC_MSG_CHECKING([whether rounding works as expected]) +AC_TRY_RUN([ +#include math.h + int main() { +return floor(0.045*pow(10,2) + 0.5)/10.0 != 0.5; + } +],[ + PHP_ROUND_FUZZ=0.5 + AC_MSG_RESULT(yes) +],[ + PHP_ROUND_FUZZ=0.501 + AC_MSG_RESULT(no) +],[ + PHP_ROUND_FUZZ=0.501 + AC_MSG_RESULT(cross compile) +]) +AC_DEFINE_UNQUOTED(PHP_ROUND_FUZZ, $PHP_ROUND_FUZZ, [ see #24142 ]) PHP_CHECK_IF_SUPPORT_PROC_OPEN Index: php-src/ext/standard/math.c diff -u php-src/ext/standard/math.c:1.105 php-src/ext/standard/math.c:1.106 --- php-src/ext/standard/math.c:1.105 Fri Aug 8 19:40:44 2003 +++ php-src/ext/standard/math.c Fri Aug 8 21:12:41 2003 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: math.c,v 1.105 2003/08/08 23:40:44 iliaa Exp $ */ +/* $Id: math.c,v 1.106 2003/08/09 01:12:41 helly Exp $ */ #include php.h #include php_math.h @@ -32,7 +32,13 @@ #define M_PI 3.14159265358979323846 #endif -#define PHP_ROUND_FUZZ 0.501 +#ifndef PHP_ROUND_FUZZ +# ifndef PHP_WIN32 +# define PHP_ROUND_FUZZ 0.501 +# else +# define PHP_ROUND_FUZZ 0.5 +# endif +#endif /* {{{ proto int abs(int number) Return the absolute value of the number */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php