From: Bruno Haible Date: Mon, 18 Nov 2019 12:57:46 +0000 (+0100) Subject: stdint: Avoid triggering a "conflicting types" error on mingw 5.22. X-Git-Tag: v1.0~4597 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=41a0105bea268492790afcdc6cc3239e6f4a0ed4;p=gnulib.git stdint: Avoid triggering a "conflicting types" error on mingw 5.22. Reported by Keith Marshall in and . * lib/stdint.in.h (intptr_t, uintptr_t): Don't define if the types have already been defined by mingw's . --- diff --git a/ChangeLog b/ChangeLog index 8f3d3a3d5f..69a1e98ffc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2019-11-18 Bruno Haible + + stdint: Avoid triggering a "conflicting types" error on mingw 5.22. + Reported by Keith Marshall in + + and . + * lib/stdint.in.h (intptr_t, uintptr_t): Don't define if the types have + already been defined by mingw's . + 2019-11-18 Bruno Haible gnulib-tool: Fix build error on macOS with --conditional-dependencies. diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 6fa7a23a81..733fcb398c 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -299,10 +299,15 @@ 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 +/* kLIBC's 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 + to avoid clashes with declarations of system functions like sbrk. + Similarly, mingw 5.22 defines _INTPTR_T_DEFINED and + _UINTPTR_T_DEFINED and needs its own definitions of intptr_t and + uintptr_t to avoid conflicting declarations of system functions like + _findclose in . */ +# if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \ + || (defined __MINGW32__ && defined _INTPTR_T_DEFINED && defined _UINTPTR_T_DEFINED)) # undef intptr_t # undef uintptr_t typedef long int gl_intptr_t;