summaryrefslogtreecommitdiff
path: root/lib/stdint.in.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2012-01-21 13:09:08 +0100
committerBruno Haible <bruno@clisp.org>2012-01-21 13:09:08 +0100
commit11cd159f52a9abb8835b1d03cd3560f5ccc06e63 (patch)
tree37966e0534e4509d507dd666ff28dc41ce842b13 /lib/stdint.in.h
parente64b4a082e60949c34383533b35e2a611c1b5084 (diff)
downloadgnulib-11cd159f52a9abb8835b1d03cd3560f5ccc06e63.tar.gz
stdint: Add support for Android.
* lib/stdint.in.h: When included from Bionic <sys/types.h>, just include the system's <stdint.h>. Reported by Simon Josefsson <simon@josefsson.org>.
Diffstat (limited to 'lib/stdint.in.h')
-rw-r--r--lib/stdint.in.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index 69e83dc233..591371c614 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -34,6 +34,14 @@
<inttypes.h>. */
#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+/* On Android (Bionic libc), <sys/types.h> includes this file before
+ having defined 'time_t'. Therefore in this case avoid including
+ other system header files; just include the system's <stdint.h>. */
+#if defined __BIONIC__ \
+ && defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
+# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+#else
+
/* Get those types that are already defined in other system include
files, so that we can "#define int8_t signed char" below without
worrying about a later system include file containing a "typedef
@@ -606,4 +614,5 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
#endif
#endif /* _@GUARD_PREFIX@_STDINT_H */
+#endif /* !(defined __BIONIC__ && ...) */
#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */