xref: /linux/tools/build/feature/test-glibc.c (revision ca55b2fef3a9373fcfc30f82fd26bc7fccbda732)
1 #include <stdlib.h>
2 
3 #if !defined(__UCLIBC__)
4 #include <gnu/libc-version.h>
5 #else
6 #define XSTR(s) STR(s)
7 #define STR(s) #s
8 #endif
9 
10 int main(void)
11 {
12 #if !defined(__UCLIBC__)
13 	const char *version = gnu_get_libc_version();
14 #else
15 	const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
16 #endif
17 
18 	return (long)version;
19 }
20