2023-10-05 19:06:15 +08:00
|
|
|
#include "libc.h"
|
|
|
|
|
|
|
|
|
|
#define FF_STR_INDIR(x) #x
|
|
|
|
|
#define FF_STR(x) FF_STR_INDIR(x)
|
|
|
|
|
|
|
|
|
|
#include <features.h>
|
|
|
|
|
|
|
|
|
|
const char* ffDetectLibc(FFLibcResult* result)
|
|
|
|
|
{
|
2023-10-08 21:03:10 +08:00
|
|
|
#ifdef __UCLIBC__
|
|
|
|
|
result->name = "uClibc";
|
|
|
|
|
result->version = FF_STR(__UCLIBC_MAJOR__) "." FF_STR(__UCLIBC_MINOR__) "." FF_STR(__UCLIBC_SUBLEVEL__);
|
|
|
|
|
#elif defined(__GNU_LIBRARY__)
|
2023-10-05 19:06:15 +08:00
|
|
|
result->name = "glibc";
|
|
|
|
|
result->version = FF_STR(__GLIBC__) "." FF_STR(__GLIBC_MINOR__);
|
|
|
|
|
#else
|
|
|
|
|
result->name = "musl";
|
2023-10-08 21:03:10 +08:00
|
|
|
#ifdef FF_MUSL_VERSION
|
|
|
|
|
result->version = FF_MUSL_VERSION;
|
|
|
|
|
#else
|
|
|
|
|
result->version = NULL;
|
|
|
|
|
#endif
|
2023-10-05 19:06:15 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|