]> Savannah Git Hosting - gnulib.git/commitdiff
stdint: check _INTPTR_T_DECLARED for intptr_t etc.
authorKO Myung-Hun <komh@chollian.net>
Fri, 15 Jan 2016 18:06:57 +0000 (10:06 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 15 Jan 2016 18:08:59 +0000 (10:08 -0800)
OS/2 kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
definitions of intptr_t and uintptr_t (which use int and unsigned)
to avoid clashes with declarations of system functions like sbrk.

* lib/stdint.in.h (intptr_t, uintptr_t): Check
_INTPTR_T_DECLARED before defining them.

lib/stdint.in.h

index d20d1c798e7a74ea557be17fe592a201555578a0..f22e7d52590f293612f2ebde8ba7b1cf69691941 100644 (file)
@@ -288,12 +288,17 @@ typedef gl_uint_fast32_t gl_uint_fast16_t;
 
 /* 7.18.1.4. Integer types capable of holding object pointers */
 
+/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
+   definitions of intptr_t and uintptr_t (which use int and unsigned)
+   to avoid clashes with declarations of system functions like sbrk.  */
+#ifndef _INTPTR_T_DECLARED
 #undef intptr_t
 #undef uintptr_t
 typedef long int gl_intptr_t;
 typedef unsigned long int gl_uintptr_t;
 #define intptr_t gl_intptr_t
 #define uintptr_t gl_uintptr_t
+#endif
 
 /* 7.18.1.5. Greatest-width integer types */