authorgravatar for xavierb@gmail.comXavier Bouchoux <xavierb@gmail.com> 2023-10-16 22:35:15+02:00
committergravatar for xavierb@gmail.comXavier Bouchoux <xavierb@gmail.com> 2023-10-16 22:43:28+02:00
log0afead56516c13c007b99d4b252db064080e2679
treee11fbf2901d5a9e89c6f9f6371471312a44096b8
parent78f2ae7f29ff537e63227d7e88e555178fed2a34

glibc patch: add backwards compatibility for strtol-family functions

following suit from b40943e253c079ec3de1b149dd2ef0ccc3da38a4, add a version guard in addition to the ISOC2X check.

1 files changed, 8 insertions(+), 0 deletions(-)

lib/libc/include/generic-glibc/features.h+8
...@@ -469,6 +469,11 @@...@@ -469,6 +469,11 @@
469# define __GLIBC_USE_DEPRECATED_SCANF 0469# define __GLIBC_USE_DEPRECATED_SCANF 0
470#endif470#endif
471471
472
473/* support for ISO C2X strtol was added in 2.38
474 * glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c
475 */
476#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2
472/* ISO C2X added support for a 0b or 0B prefix on binary constants as477/* ISO C2X added support for a 0b or 0B prefix on binary constants as
473 inputs to strtol-family functions (base 0 or 2). This macro is478 inputs to strtol-family functions (base 0 or 2). This macro is
474 used to condition redirection in headers to allow that redirection479 used to condition redirection in headers to allow that redirection
...@@ -479,6 +484,9 @@...@@ -479,6 +484,9 @@
479#else484#else
480# define __GLIBC_USE_C2X_STRTOL 0485# define __GLIBC_USE_C2X_STRTOL 0
481#endif486#endif
487#else /* glibc 2.37 or lower */
488# define __GLIBC_USE_C2X_STRTOL 0
489#endif
482490
483/* Get definitions of __STDC_* predefined macros, if the compiler has491/* Get definitions of __STDC_* predefined macros, if the compiler has
484 not preincluded this header automatically. */492 not preincluded this header automatically. */