master ohmu/fastfetch-openbsd / src / detection / libc / libc_linux.c
ohmu  ·  2026-10-15
 1#include "libc.h"
 2#include "common/strutil.h"
 3
 4#include <features.h>
 5
 6const char* ffDetectLibc(FFLibcResult* result) {
 7#ifdef __UCLIBC__
 8    result->name = "uClibc";
 9    result->version = FF_STR(__UCLIBC_MAJOR__) "." FF_STR(__UCLIBC_MINOR__) "." FF_STR(__UCLIBC_SUBLEVEL__);
10#elif defined(__GNU_LIBRARY__)
11    result->name = "glibc";
12    result->version = FF_STR(__GLIBC__) "." FF_STR(__GLIBC_MINOR__);
13#else
14    result->name = "musl";
15    #ifdef FF_MUSL_VERSION
16    result->version = FF_MUSL_VERSION;
17    #else
18    result->version = nullptr;
19    #endif
20#endif
21
22    return nullptr;
23}