KO Myung-Hun wrote:
+#ifndef __KLIBC__
  typedef long int gl_intptr_t;
  typedef unsigned long int gl_uintptr_t;
+#else
+typedef int gl_intptr_t;
+typedef unsigned int gl_uintptr_t;
+#endif

This looks brittle.

First, why is it used at all? That is, what's wrong with kLIBC's stdint.h, which causes gnulib to replace stdint.h?

Second, since kLIBC has its own intptr_t etc., I expect it'll be better to use kLIBC's version rather than guess what it will be in future versions. How about something like this instead?

/* 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

Reply via email to