zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 9f9fa2df932fafe21134fc9bbf82fec282739d70 (tree)
parent 7c4bf07060ff234da301dce759bc6678b96d8831
Author: Xavier Bouchoux <xavierb@gmail.com>
Date:   Mon, 16 Oct 2023 22:35:15 +0200

glibc patch: add backwards compatibility for strtol-family functions

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

Diffstat:
Mlib/libc/include/generic-glibc/features.h | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/libc/include/generic-glibc/features.h b/lib/libc/include/generic-glibc/features.h @@ -470,6 +470,11 @@ # define __GLIBC_USE_DEPRECATED_SCANF 0 #endif + +/* support for ISO C2X strtol was added in 2.38 + * glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c + */ +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2 /* ISO C2X added support for a 0b or 0B prefix on binary constants as inputs to strtol-family functions (base 0 or 2). This macro is used to condition redirection in headers to allow that redirection @@ -480,6 +485,9 @@ #else # define __GLIBC_USE_C2X_STRTOL 0 #endif +#else /* glibc 2.37 or lower */ +# define __GLIBC_USE_C2X_STRTOL 0 +#endif /* Get definitions of __STDC_* predefined macros, if the compiler has not preincluded this header automatically. */