test-glibc.c 325 B

12345678910111213141516171819
  1. #include <stdlib.h>
  2. #if !defined(__UCLIBC__)
  3. #include <gnu/libc-version.h>
  4. #else
  5. #define XSTR(s) STR(s)
  6. #define STR(s) #s
  7. #endif
  8. int main(void)
  9. {
  10. #if !defined(__UCLIBC__)
  11. const char *version = gnu_get_libc_version();
  12. #else
  13. const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
  14. #endif
  15. return (long)version;
  16. }