config.cpp: fix environ for Apple (#34)

This commit is contained in:
Sergey Fedorov 2024-03-24 11:20:55 +08:00 committed by GitHub
parent a2f3942114
commit b3e430f81f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -10,7 +10,13 @@
#include <cstring> #include <cstring>
using namespace Hyprlang; using namespace Hyprlang;
#ifdef __APPLE__
#include <crt_externs.h>
#define environ (*_NSGetEnviron())
#else
extern "C" char** environ; extern "C" char** environ;
#endif
// defines // defines
inline constexpr const char* ANONYMOUS_KEY = "__hyprlang_internal_anonymous_key"; inline constexpr const char* ANONYMOUS_KEY = "__hyprlang_internal_anonymous_key";