Skip to content

Commit 0afead5

Browse files
committed
glibc patch: add backwards compatibility for strtol-family functions
following suit from b40943e, add a version guard in addition to the ISOC2X check.
1 parent 78f2ae7 commit 0afead5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/libc/include/generic-glibc/features.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,11 @@
469469
# define __GLIBC_USE_DEPRECATED_SCANF 0
470470
#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
472477
/* ISO C2X added support for a 0b or 0B prefix on binary constants as
473478
inputs to strtol-family functions (base 0 or 2). This macro is
474479
used to condition redirection in headers to allow that redirection
@@ -479,6 +484,9 @@
479484
#else
480485
# define __GLIBC_USE_C2X_STRTOL 0
481486
#endif
487+
#else /* glibc 2.37 or lower */
488+
# define __GLIBC_USE_C2X_STRTOL 0
489+
#endif
482490

483491
/* Get definitions of __STDC_* predefined macros, if the compiler has
484492
not preincluded this header automatically. */

0 commit comments

Comments
 (0)