com php-src: backported the timelib cleanups to 5.6: ext/date/config.w32 ext/date/config0.m4 ext/date/lib/timelib_structs.h
| From: | Anatol Belski | Date: | Wed, 21 Jan 2015 10:03:16 +0000 |
| Subject: | com php-src: backported the timelib cleanups to 5.6: ext/date/config.w32 ext/date/config0.m4 ext/date/lib/timelib_structs.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84272@lists.php.net to get a copy of this message | ||
Commit: 9c88a214a4e8430970b043ebc9ee7a72381e3b00
Author: Anatol Belski <ab@php.net> Wed, 21 Jan 2015 11:03:16 +0100
Parents: 57ff5a4e6fb5b2c5cf2fe9441af8c6e48c22fe67
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9c88a214a4e8430970b043ebc9ee7a72381e3b00
Log:
backported the timelib cleanups to 5..6
Changed paths:
M ext/date/config.w32
M ext/date/config0.m4
M ext/date/lib/timelib_structs.h
Diff:
diff --git a/ext/date/config.w32 b/ext/date/config.w32
index c97df72..2f25c72 100755
--- a/ext/date/config.w32
+++ b/ext/date/config.w32
@@ -9,6 +9,8 @@ ADD_FLAG('CFLAGS_DATE', "/wd4244");
var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true);
tl_config.WriteLine("#include \"config.w32.h\"");
+tl_config.WriteLine("#include <php_stdint.h>");
+tl_config.WriteLine("#define TIMELIB_OMIT_STDINT 1");
tl_config.Close();
PHP_INSTALL_HEADERS("ext/date/", "php_date.h lib/timelib.h lib/timelib_structs.h
lib/timelib_config.h");
diff --git a/ext/date/config0.m4 b/ext/date/config0.m4
index 0b46c68..79e12ec 100644
--- a/ext/date/config0.m4
+++ b/ext/date/config0.m4
@@ -23,4 +23,5 @@ cat > $ext_builddir/lib/timelib_config.h <<EOF
# include <php_config.h>
#endif
#include <php_stdint.h>
+#define TIMELIB_OMIT_STDINT 1
EOF
diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h
index cfe249c..999ce53 100644
--- a/ext/date/lib/timelib_structs.h
+++ b/ext/date/lib/timelib_structs.h
@@ -23,7 +23,89 @@
#include "timelib_config.h"
-#include "php_stdint.h"
+#ifndef TIMELIB_OMIT_STDINT
+
+#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
+
+#ifdef _WIN32
+# if _MSC_VER >= 1600
+# include <stdint.h>
+# endif
+# ifndef SIZEOF_INT
+# define SIZEOF_INT 4
+# endif
+# ifndef SIZEOF_LONG
+# define SIZEOF_LONG 4
+# endif
+# ifndef int32_t
+typedef __int32 int32_t;
+# endif
+# ifndef uint32_t
+typedef unsigned __int32 uint32_t;
+# endif
+# ifndef int64_t
+typedef __int64 int64_t;
+# endif
+# ifndef uint64_t
+typedef unsigned __int64 uint64_t;
+# endif
+# ifndef PRId32
+# define PRId32 "I32d"
+# endif
+# ifndef PRIu32
+# define PRIu32 "I32u"
+# endif
+# ifndef PRId64
+# define PRId64 "I64d"
+# endif
+# ifndef PRIu64
+# define PRIu64 "I64u"
+# endif
+# ifndef INT32_MAX
+#define INT32_MAX _I32_MAX
+# endif
+# ifndef INT32_MIN
+#define INT32_MIN ((int32_t)_I32_MIN)
+# endif
+# ifndef UINT32_MAX
+#define UINT32_MAX _UI32_MAX
+# endif
+# ifndef INT64_MIN
+#define INT64_MIN ((int64_t)_I64_MIN)
+# endif
+# ifndef INT64_MAX
+#define INT64_MAX _I64_MAX
+# endif
+# ifndef UINT64_MAX
+#define UINT64_MAX _UI64_MAX
+# endif
+#endif
+
+#endif /* TIMELIB_OMIT_STDINT */
#include <stdio.h>