blob: 9367f7586676b850d43410bfc0cb75a4c88816c6 [file] [log] [blame]
Petri Gyntherf151f532015-08-04 17:38:01 -07001#include <stdlib.h>
2
3#if !defined(__UCLIBC__)
Ingo Molnare12762c2013-10-07 10:34:20 +02004#include <gnu/libc-version.h>
Petri Gyntherf151f532015-08-04 17:38:01 -07005#else
6#define XSTR(s) STR(s)
7#define STR(s) #s
8#endif
Ingo Molnare12762c2013-10-07 10:34:20 +02009
10int main(void)
11{
Petri Gyntherf151f532015-08-04 17:38:01 -070012#if !defined(__UCLIBC__)
Ingo Molnare12762c2013-10-07 10:34:20 +020013 const char *version = gnu_get_libc_version();
Petri Gyntherf151f532015-08-04 17:38:01 -070014#else
15 const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
16#endif
Ingo Molnar20c99e82013-10-07 13:27:23 +020017
Ingo Molnare12762c2013-10-07 10:34:20 +020018 return (long)version;
19}