add workaround for musl (#317)

This commit is contained in:
ouwou 2024-06-21 20:04:35 -04:00
parent acec22393b
commit 7af15b326d

View File

@ -1,4 +1,5 @@
#include "abaddon.hpp" #include "abaddon.hpp"
#include <cstdlib>
#include <memory> #include <memory>
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#include <spdlog/cfg/env.h> #include <spdlog/cfg/env.h>
@ -1153,7 +1154,32 @@ void Abaddon::on_window_hide() {
} }
} }
// clang-format off
#ifdef __GLIBC__
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#include <features.h>
#ifndef __USE_GNU
#define __MUSL__
#endif
#undef _GNU_SOURCE
#else
#include <features.h>
#ifndef __USE_GNU
#define __MUSL__
#endif
#endif
#endif
// clang-format on
int main(int argc, char **argv) { int main(int argc, char **argv) {
#ifdef __MUSL__
char env[] = "LANG=C";
putenv(env);
#endif
if (std::getenv("ABADDON_NO_FC") == nullptr) if (std::getenv("ABADDON_NO_FC") == nullptr)
Platform::SetupFonts(); Platform::SetupFonts();