diff --git a/qga/commands-posix.c b/qga/commands-posix.c index dab3bf9c9875629806f930cc46693d3f6a8b19de..4a71c27c4a20172f6cd7576d7b803df82ef5b664 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -22,8 +22,13 @@ #include "host-utils.h" #ifndef CONFIG_HAS_ENVIRON +#ifdef __APPLE__ +#include +#define environ (*_NSGetEnviron()) +#else extern char **environ; #endif +#endif #if defined(__linux__) #include