authorgravatar for xavierb@gmail.comXavier Bouchoux <xavierb@gmail.com> 2023-10-16 22:35:15+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-06-05 22:43:53-07:00
log9f9fa2df932fafe21134fc9bbf82fec282739d70
treeb957623057988e3ae76938c835b6c9aa253d2040
parent7c4bf07060ff234da301dce759bc6678b96d8831

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
...@@ -470,6 +470,11 @@...@@ -470,6 +470,11 @@
470# define __GLIBC_USE_DEPRECATED_SCANF 0470# define __GLIBC_USE_DEPRECATED_SCANF 0
471#endif471#endif
472472
473
474/* support for ISO C2X strtol was added in 2.38
475 * glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c
476 */
477#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2
473/* ISO C2X added support for a 0b or 0B prefix on binary constants as478/* ISO C2X added support for a 0b or 0B prefix on binary constants as
474 inputs to strtol-family functions (base 0 or 2). This macro is479 inputs to strtol-family functions (base 0 or 2). This macro is
475 used to condition redirection in headers to allow that redirection480 used to condition redirection in headers to allow that redirection
...@@ -480,6 +485,9 @@...@@ -480,6 +485,9 @@
480#else485#else
481# define __GLIBC_USE_C2X_STRTOL 0486# define __GLIBC_USE_C2X_STRTOL 0
482#endif487#endif
488#else /* glibc 2.37 or lower */
489# define __GLIBC_USE_C2X_STRTOL 0
490#endif
483491
484/* Get definitions of __STDC_* predefined macros, if the compiler has492/* Get definitions of __STDC_* predefined macros, if the compiler has
485 not preincluded this header automatically. */493 not preincluded this header automatically. */