mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Fix LONG_WIDTH, ULONG_WIDTH include ordering issue.
As described in <https://sourceware.org/ml/libc-alpha/2016-10/msg00047.html>, there is an include ordering issue with the integer width macros in glibc's <limits.h>, where definitions conditional on LONG_MAX do not work as intended because when the headers are installed, this part of glibc's <limits.h> is processed before the part of GCC's <limits.h> that will define LONG_MAX. This patch changes the definitions just to use __WORDSIZE for the expansion of LONG_WIDTH and ULONG_WIDTH rather than making those definitions conditional on LONG_MAX. Tested for x86_64 and x86. * include/limits.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH): Define to __WORDSIZE, not conditional on [LONG_MAX == 0x7fffffffL]. [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise.
This commit is contained in:
@@ -164,20 +164,11 @@
|
||||
# ifndef UINT_WIDTH
|
||||
# define UINT_WIDTH 32
|
||||
# endif
|
||||
# if LONG_MAX == 0x7fffffffL
|
||||
# ifndef LONG_WIDTH
|
||||
# define LONG_WIDTH 32
|
||||
# endif
|
||||
# ifndef ULONG_WIDTH
|
||||
# define ULONG_WIDTH 32
|
||||
# endif
|
||||
# else
|
||||
# ifndef LONG_WIDTH
|
||||
# define LONG_WIDTH 64
|
||||
# endif
|
||||
# ifndef ULONG_WIDTH
|
||||
# define ULONG_WIDTH 64
|
||||
# endif
|
||||
# ifndef LONG_WIDTH
|
||||
# define LONG_WIDTH __WORDSIZE
|
||||
# endif
|
||||
# ifndef ULONG_WIDTH
|
||||
# define ULONG_WIDTH __WORDSIZE
|
||||
# endif
|
||||
# ifndef LLONG_WIDTH
|
||||
# define LLONG_WIDTH 64
|
||||
|
||||
Reference in New Issue
Block a user