sniper Thu Jun 16 19:12:11 2005 EDT Added files: /php-src/ext/date/lib timelib.m4
Modified files: /php-src/ext/date config.m4 php_date.c /php-src/ext/date/lib .cvsignore dow.c parse_date.c parse_tz.c timelib.c timelib.h timelib_structs.h tm2unixtime.c unixtime2tm.c /php-src/ext/date/lib/resource parse_date.re Log: - Improve portability. # TODO: The standalone lib needs it's own build stuff, pretty much same as # Zend has for standalone builds.
http://cvs.php.net/diff.php/php-src/ext/date/config.m4?r1=1.5&r2=1.6&ty=u Index: php-src/ext/date/config.m4 diff -u php-src/ext/date/config.m4:1.5 php-src/ext/date/config.m4:1.6 --- php-src/ext/date/config.m4:1.5 Thu Jun 16 17:23:16 2005 +++ php-src/ext/date/config.m4 Thu Jun 16 19:12:08 2005 @@ -1,9 +1,22 @@ -dnl $Id: config.m4,v 1.5 2005/06/16 21:23:16 sniper Exp $ +dnl $Id: config.m4,v 1.6 2005/06/16 23:12:08 sniper Exp $ dnl config.m4 for date extension -PHP_DATE_CFLAGS="[EMAIL PROTECTED]@/lib" +sinclude(ext/date/lib/timelib.m4) +sinclude(lib/timelib.m4) + +PHP_DATE_CFLAGS="[EMAIL PROTECTED]@/lib" timelib_sources="lib/dow.c lib/parse_date.c lib/parse_tz.c lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c" PHP_NEW_EXTENSION(date, php_date.c $timelib_sources, no,, $PHP_DATE_CFLAGS) -PHP_ADD_BUILD_DIR([$ext_builddir/lib]) +PHP_ADD_BUILD_DIR([$ext_builddir/lib], 1) + +cat >> $ext_builddir/lib/tl_config.h <<EOF +#if PHP_WIN32 +# include "config.w32.h" +#elif defined(NETWARE) +# include "config.nw.h" +#else +# include <php_config.h> +#endif +EOF http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.8&r2=1.9&ty=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.8 php-src/ext/date/php_date.c:1.9 --- php-src/ext/date/php_date.c:1.8 Thu Jun 16 13:12:41 2005 +++ php-src/ext/date/php_date.c Thu Jun 16 19:12:08 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.8 2005/06/16 17:12:41 derick Exp $ */ +/* $Id: php_date.c,v 1.9 2005/06/16 23:12:08 sniper Exp $ */ #include "php.h" #include "php_streams.h" @@ -25,7 +25,6 @@ #include "php_ini.h" #include "ext/standard/info.h" #include "php_date.h" -#include "lib/timelib_structs.h" #include "lib/timelib.h" #include <time.h> http://cvs.php.net/diff.php/php-src/ext/date/lib/.cvsignore?r1=1.2&r2=1.3&ty=u Index: php-src/ext/date/lib/.cvsignore diff -u php-src/ext/date/lib/.cvsignore:1.2 php-src/ext/date/lib/.cvsignore:1.3 --- php-src/ext/date/lib/.cvsignore:1.2 Thu Jun 16 17:22:33 2005 +++ php-src/ext/date/lib/.cvsignore Thu Jun 16 19:12:09 2005 @@ -5,3 +5,4 @@ .libs *.gcda *.gcno +tl_config.h http://cvs.php.net/diff.php/php-src/ext/date/lib/dow.c?r1=1.2&r2=1.3&ty=u Index: php-src/ext/date/lib/dow.c diff -u php-src/ext/date/lib/dow.c:1.2 php-src/ext/date/lib/dow.c:1.3 --- php-src/ext/date/lib/dow.c:1.2 Wed Jun 15 07:01:04 2005 +++ php-src/ext/date/lib/dow.c Thu Jun 16 19:12:09 2005 @@ -16,7 +16,9 @@ +----------------------------------------------------------------------+ */ -/* $Id: dow.c,v 1.2 2005/06/15 11:01:04 derick Exp $ */ +/* $Id: dow.c,v 1.3 2005/06/16 23:12:09 sniper Exp $ */ + +#include <tl_config.h> #include "timelib_structs.h" http://cvs.php.net/diff.php/php-src/ext/date/lib/parse_date.c?r1=1.9&r2=1.10&ty=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.9 php-src/ext/date/lib/parse_date.c:1.10 --- php-src/ext/date/lib/parse_date.c:1.9 Thu Jun 16 13:12:41 2005 +++ php-src/ext/date/lib/parse_date.c Thu Jun 16 19:12:09 2005 @@ -18,11 +18,21 @@ +----------------------------------------------------------------------+ */ -/* $Id: parse_date.c,v 1.9 2005/06/16 17:12:41 derick Exp $ */ +/* $Id: parse_date.c,v 1.10 2005/06/16 23:12:09 sniper Exp $ */ + +#include <tl_config.h> -#include <stdlib.h> #include <stdio.h> + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_STRING_H #include <string.h> +#else +#include <strings.h> +#endif + #include "timelib.h" #if defined(_MSC_VER) http://cvs.php.net/diff.php/php-src/ext/date/lib/parse_tz.c?r1=1.6&r2=1.7&ty=u Index: php-src/ext/date/lib/parse_tz.c diff -u php-src/ext/date/lib/parse_tz.c:1.6 php-src/ext/date/lib/parse_tz.c:1.7 --- php-src/ext/date/lib/parse_tz.c:1.6 Thu Jun 16 14:34:42 2005 +++ php-src/ext/date/lib/parse_tz.c Thu Jun 16 19:12:10 2005 @@ -16,15 +16,17 @@ +----------------------------------------------------------------------+ */ -/* $Id: parse_tz.c,v 1.6 2005/06/16 18:34:42 derick Exp $ */ +/* $Id: parse_tz.c,v 1.7 2005/06/16 23:12:10 sniper Exp $ */ + +#include <tl_config.h> #include <stdio.h> -#ifdef WIN32 -#include <winsock2.h> + +#ifdef HAVE_STRING_H +#include <string.h> #else -#include <inttypes.h> +#include <strings.h> #endif -#include <string.h> #include "timelib.h" #include "timezonedb.h" http://cvs.php.net/diff.php/php-src/ext/date/lib/timelib.c?r1=1.1&r2=1.2&ty=u Index: php-src/ext/date/lib/timelib.c diff -u php-src/ext/date/lib/timelib.c:1.1 php-src/ext/date/lib/timelib.c:1.2 --- php-src/ext/date/lib/timelib.c:1.1 Thu Jun 16 13:12:41 2005 +++ php-src/ext/date/lib/timelib.c Thu Jun 16 19:12:10 2005 @@ -16,7 +16,9 @@ +----------------------------------------------------------------------+ */ -/* $Id: timelib.c,v 1.1 2005/06/16 17:12:41 derick Exp $ */ +/* $Id: timelib.c,v 1.2 2005/06/16 23:12:10 sniper Exp $ */ + +#include <tl_config.h> #include "timelib_structs.h" #include "timelib.h" http://cvs.php.net/diff.php/php-src/ext/date/lib/timelib.h?r1=1.2&r2=1.3&ty=u Index: php-src/ext/date/lib/timelib.h diff -u php-src/ext/date/lib/timelib.h:1.2 php-src/ext/date/lib/timelib.h:1.3 --- php-src/ext/date/lib/timelib.h:1.2 Thu Jun 16 14:34:42 2005 +++ php-src/ext/date/lib/timelib.h Thu Jun 16 19:12:10 2005 @@ -16,7 +16,10 @@ +----------------------------------------------------------------------+ */ -/* $Id: timelib.h,v 1.2 2005/06/16 18:34:42 derick Exp $ */ +/* $Id: timelib.h,v 1.3 2005/06/16 23:12:10 sniper Exp $ */ + +#ifndef __TIMELIB_H__ +#define __TIMELIB_H__ #include "timelib_structs.h" @@ -31,7 +34,6 @@ #define LONG_MIN (- LONG_MAX - 1) #endif - /* From dow.c */ timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d); timelib_sll timelib_daynr_from_weeknr(timelib_sll y, timelib_sll w, timelib_sll d); @@ -71,3 +73,4 @@ signed long timelib_date_to_int(timelib_time *d, int *error); void timelib_dump_date(timelib_time *d, int options); +#endif http://cvs.php.net/diff.php/php-src/ext/date/lib/timelib_structs.h?r1=1.6&r2=1.7&ty=u Index: php-src/ext/date/lib/timelib_structs.h diff -u php-src/ext/date/lib/timelib_structs.h:1.6 php-src/ext/date/lib/timelib_structs.h:1.7 --- php-src/ext/date/lib/timelib_structs.h:1.6 Thu Jun 16 14:34:42 2005 +++ php-src/ext/date/lib/timelib_structs.h Thu Jun 16 19:12:10 2005 @@ -16,18 +16,47 @@ +----------------------------------------------------------------------+ */ -/* $Id: timelib_structs.h,v 1.6 2005/06/16 18:34:42 derick Exp $ */ +/* $Id: timelib_structs.h,v 1.7 2005/06/16 23:12:10 sniper Exp $ */ #ifndef __TIMELIB_STRUCTS_H__ #define __TIMELIB_STRUCTS_H__ -#include <stdlib.h> +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + +#if defined(HAVE_INTTYPES_H) +#include <inttypes.h> +#elif defined(HAVE_STDINT_H) +#include <stdint.h> +#endif + +#ifndef HAVE_INT32_T +# if SIZEOF_INT == 4 +typedef int int32_t; +# elif SIZEOF_LONG == 4 +typedef long int int32_t; +# endif +#endif + +#ifndef HAVE_UINT32_T +# if SIZEOF_INT == 4 +typedef unsigned int uint32_t; +# elif SIZEOF_LONG == 4 +typedef unsigned long int uint32_t; +# endif +#endif + #include <stdio.h> + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#ifdef HAVE_STRING_H #include <string.h> -#ifdef WIN32 -#include <winsock2.h> #else -#include <inttypes.h> +#include <strings.h> #endif #if defined(_MSC_VER) && _MSC_VER < 1300 @@ -125,4 +154,5 @@ #define is_leap(y) ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0)) #define DEBUG(s) if (0) { s } + #endif http://cvs.php.net/diff.php/php-src/ext/date/lib/tm2unixtime.c?r1=1.5&r2=1.6&ty=u Index: php-src/ext/date/lib/tm2unixtime.c diff -u php-src/ext/date/lib/tm2unixtime.c:1.5 php-src/ext/date/lib/tm2unixtime.c:1.6 --- php-src/ext/date/lib/tm2unixtime.c:1.5 Thu Jun 16 13:12:41 2005 +++ php-src/ext/date/lib/tm2unixtime.c Thu Jun 16 19:12:10 2005 @@ -16,8 +16,9 @@ +----------------------------------------------------------------------+ */ -/* $Id: tm2unixtime.c,v 1.5 2005/06/16 17:12:41 derick Exp $ */ +/* $Id: tm2unixtime.c,v 1.6 2005/06/16 23:12:10 sniper Exp $ */ +#include <tl_config.h> #include "timelib.h" /* jan feb mrt apr may jun jul aug sep oct nov dec */ http://cvs.php.net/diff.php/php-src/ext/date/lib/unixtime2tm.c?r1=1.4&r2=1.5&ty=u Index: php-src/ext/date/lib/unixtime2tm.c diff -u php-src/ext/date/lib/unixtime2tm.c:1.4 php-src/ext/date/lib/unixtime2tm.c:1.5 --- php-src/ext/date/lib/unixtime2tm.c:1.4 Thu Jun 16 13:12:41 2005 +++ php-src/ext/date/lib/unixtime2tm.c Thu Jun 16 19:12:10 2005 @@ -16,11 +16,21 @@ +----------------------------------------------------------------------+ */ -/* $Id: unixtime2tm.c,v 1.4 2005/06/16 17:12:41 derick Exp $ */ +/* $Id: unixtime2tm.c,v 1.5 2005/06/16 23:12:10 sniper Exp $ */ + +#include <tl_config.h> -#include <stdlib.h> #include <stdio.h> + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#ifdef HAVE_STRING_H #include <string.h> +#else +#include <strings.h> +#endif #if defined(_MSC_VER) #define TIMELIB_LL_CONST(n) n ## i64 http://cvs.php.net/diff.php/php-src/ext/date/lib/resource/parse_date.re?r1=1.8&r2=1.9&ty=u Index: php-src/ext/date/lib/resource/parse_date.re diff -u php-src/ext/date/lib/resource/parse_date.re:1.8 php-src/ext/date/lib/resource/parse_date.re:1.9 --- php-src/ext/date/lib/resource/parse_date.re:1.8 Thu Jun 16 13:12:41 2005 +++ php-src/ext/date/lib/resource/parse_date.re Thu Jun 16 19:12:10 2005 @@ -16,11 +16,21 @@ +----------------------------------------------------------------------+ */ -/* $Id: parse_date.re,v 1.8 2005/06/16 17:12:41 derick Exp $ */ +/* $Id: parse_date.re,v 1.9 2005/06/16 23:12:10 sniper Exp $ */ + +#include <tl_config.h> -#include <stdlib.h> #include <stdio.h> + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_STRING_H #include <string.h> +#else +#include <strings.h> +#endif + #include "timelib.h" #if defined(_MSC_VER) http://cvs.php.net/co.php/php-src/ext/date/lib/timelib.m4?r=1.1&p=1 Index: php-src/ext/date/lib/timelib.m4 +++ php-src/ext/date/lib/timelib.m4 dnl dnl $Id: timelib.m4,v 1.1 2005/06/16 23:12:10 sniper Exp $ dnl dnl dnl TL_DEF_HAVE(what [, why]) dnl dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [WHY])' dnl AC_DEFUN([TL_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___),1,[ $2 ])])dnl dnl dnl TL_CHECK_INT_TYPE(type) dnl AC_DEFUN([TL_CHECK_INT_TYPE],[ AC_CACHE_CHECK([for $1], ac_cv_int_type_$1, [ AC_TRY_COMPILE([ #if HAVE_SYS_TYPES_H # include <sys/types.h> #endif #if HAVE_INTTYPES_H # include <inttypes.h> #elif HAVE_STDINT_H # include <stdint.h> #endif], [if (($1 *) 0) return 0; if (sizeof ($1)) return 0; ], [ac_cv_int_type_$1=yes], [ac_cv_int_type_$1=no]) ]) if test "$ac_cv_int_type_$1" = "yes"; then TL_DEF_HAVE($1, [Define if $1 type is present.]) fi ])dnl dnl Check for types, sizes, etc. needed by timelib AC_CHECK_SIZEOF(long, 8) AC_CHECK_SIZEOF(int, 4) TL_CHECK_INT_TYPE(int32_t) TL_CHECK_INT_TYPE(uint32_t) dnl Check for headers needed by timelib AC_CHECK_HEADERS([ \ sys/types.h \ inttypes.h \ stdint.h \ string.h \ stdlib.h ])
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php