aboutsummaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
Diffstat (limited to 'qga')
-rw-r--r--qga/commands-posix.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index dab3bf9c98..4a71c27c4a 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 <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#else
extern char **environ;
#endif
+#endif
#if defined(__linux__)
#include <mntent.h>