changeset 17625:e2f490eebebe

stdint, read-file: fix missing SIZE_MAX on Android (tiny change) This is basically one of the options Bruno Haible proposed in: http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00282.html * lib/sys_types.in.h (_GL_INCLUDING_UNISTD_H): New macro. * lib/stdint.in.h: Use it. * modules/stdint (Depends-on): Add sys_types.
author Kevin Cernekee <cernekee@gmail.com>
date Wed, 05 Mar 2014 12:10:56 -0800
parents 3cf8cbc50647
children 633b90cd640f
files ChangeLog lib/stdint.in.h lib/sys_types.in.h modules/stdint
diffstat 4 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 25 10:58:48 2014 +0000
+++ b/ChangeLog	Wed Mar 05 12:10:56 2014 -0800
@@ -1,3 +1,15 @@
+2014-03-04  Kevin Cernekee <cernekee@gmail.com>
+
+	stdint, read-file: fix missing SIZE_MAX on Android
+	* lib/sys_types.in.h (_GL_INCLUDING_UNISTD_H): New macro, to work
+	around potential circular dependencies when stdint.h is included
+	by the system's sys/types.h.
+	* lib/stdint.in.h: Use _GL_INCLUDING_UNISTD_H to figure out if
+	we're being included from sys/types.h, as merely checking
+	_SYS_TYPES_H_ could return true if sys/types.h had been previously
+	included.
+	* modules/stdint (Depends-on): Add sys_types.
+
 2014-02-26  Pádraig Brady <P@draigBrady.com>
 
 	parse-datetime: fix crash or infloop in TZ="" parsing
--- a/lib/stdint.in.h	Tue Feb 25 10:58:48 2014 +0000
+++ b/lib/stdint.in.h	Wed Mar 05 12:10:56 2014 -0800
@@ -38,8 +38,7 @@
    other system header files; just include the system's <stdint.h>.
    Ideally we should test __BIONIC__ here, but it is only defined after
    <sys/cdefs.h> has been included; hence test __ANDROID__ instead.  */
-#if defined __ANDROID__ \
-    && defined _SYS_TYPES_H_ && !defined __need_size_t
+#if defined __ANDROID__ && defined _GL_INCLUDING_SYS_TYPES_H
 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
 #else
 
--- a/lib/sys_types.in.h	Tue Feb 25 10:58:48 2014 +0000
+++ b/lib/sys_types.in.h	Wed Mar 05 12:10:56 2014 -0800
@@ -23,7 +23,9 @@
 #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
 
 /* The include_next requires a split double-inclusion guard.  */
+# define _GL_INCLUDING_SYS_TYPES_H
 #@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+# undef _GL_INCLUDING_SYS_TYPES_H
 
 #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
 #define _@GUARD_PREFIX@_SYS_TYPES_H
--- a/modules/stdint	Tue Feb 25 10:58:48 2014 +0000
+++ b/modules/stdint	Wed Mar 05 12:10:56 2014 -0800
@@ -14,6 +14,7 @@
 Depends-on:
 include_next
 multiarch
+sys_types
 
 configure.ac:
 gl_STDINT_H