authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2024-03-26 13:56:07+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-03-26 13:56:07+02:00
log59203cb4f2a924d5815cbb9cca54a10cabf74292
treed06d4b5e1e522ef534e05ec0d129b59d2a762692
parent29e41c6850feac60e908a46756c168cb3026381e
parentfc72630d0f86499ea154f985b8588999dc47c53d
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #19385 from markus-oberhumer-forks/improve-old-glibc-versions

Improve old glibc versions

1 files changed, 12 insertions(+), 9 deletions(-)

lib/libc/include/generic-glibc/features.h+12-9
......@@ -159,6 +159,14 @@
159159# define __KERNEL_STRICT_NAMES
160160#endif
161161
162/* Major and minor version number of the GNU C library package. Use
163 these macros to test for features in specific releases. */
164#define __GLIBC__ 2
165/* Zig patch: we pass `-D__GLIBC_MINOR__=XX` depending on the target. */
166
167#define __GLIBC_PREREQ(maj, min) \
168 ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
169
162170/* Convenience macro to test the version of gcc.
163171 Use like this:
164172 #if __GNUC_PREREQ (2,8)
......@@ -460,7 +468,10 @@
460468 instance, with GCC, -std=gnu11 will have C99-compliant scanf with
461469 or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the
462470 old extension. */
463#if (defined __USE_GNU \
471#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
472/* support for ISOC99 was added in glibc-2.7 */
473# define __GLIBC_USE_DEPRECATED_SCANF 1
474#elif (defined __USE_GNU \
464475 && (defined __cplusplus \
465476 ? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \
466477 : (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L)))
......@@ -501,14 +512,6 @@
501512#undef __GNU_LIBRARY__
502513#define __GNU_LIBRARY__ 6
503514
504/* Major and minor version number of the GNU C library package. Use
505 these macros to test for features in specific releases. */
506#define __GLIBC__ 2
507/* Zig patch: we pass `-D__GLIBC_MINOR__=XX` depending on the target. */
508
509#define __GLIBC_PREREQ(maj, min) \
510 ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
511
512515/* This is here only because every header file already includes this one. */
513516#ifndef __ASSEMBLER__
514517# ifndef _SYS_CDEFS_H