]> granicus.if.org Git - php/commitdiff
Fixes to unified stdint usage
authorAnatol Belski <ab@php.net>
Mon, 12 Aug 2013 11:39:17 +0000 (13:39 +0200)
committerAnatol Belski <ab@php.net>
Mon, 12 Aug 2013 11:39:17 +0000 (13:39 +0200)
This recalls 14caf174ff219376e4f1234bd297ffe973cc416e

ext/date/lib/timelib_structs.h
main/php_stdint.h

index 5d1d9633306256ba144e47f5f9de10da6e16421b..cc12eb38a6f043d165ae2dbd96da7bfec2b8806a 100644 (file)
 
 #include "timelib_config.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 "php_stdint.h"
 
 #include <stdio.h>
 
@@ -62,8 +38,8 @@ typedef unsigned long int uint32_t;
 #endif
 
 #if defined(_MSC_VER)
-typedef __uint64 timelib_ull;
-typedef __int64 timelib_sll;
+typedef uint64_t timelib_ull;
+typedef int64_t timelib_sll;
 # define TIMELIB_LL_CONST(n) n ## i64
 #else
 typedef unsigned long long timelib_ull;
index c8300d949e7fca262eed0aeac5bb228c66ebef3a..87edb0fde085a994d0204a4333120bf72a053d24 100644 (file)
 #ifndef PHP_STDINT_H
 #define PHP_STDINT_H
 
-#if PHP_WIN32
-# include "win32/php_stdint.h"
+#if defined(_MSC_VER)
+/* Make sure the regular stdint.h wasn't included already and prevent it to be
+   included afterwards. Though if some other library needs some stuff from
+   stdint.h included afterwards and misses it, we'd have to extend ours. On
+   the other hand, if stdint.h was included before, some conflicts might
+   happen so we'd likewise have to fix ours. */
+# if !defined(_STDINT)
+#  define _STDINT
+#  include "win32/php_stdint.h"
+# endif
 # define HAVE_INT8_T   1
 # define HAVE_UINT8_T  1
 # define HAVE_INT16_T  1