gtest_extras: fix macOS build.
macOS doesn't have clearenv(), so fake it.
Test: treehugger
Change-Id: I361836c7e661a129095518e9514a4a911add07c9
diff --git a/tests/SystemTests.cpp b/tests/SystemTests.cpp
index e956640..dbbf39a 100644
--- a/tests/SystemTests.cpp
+++ b/tests/SystemTests.cpp
@@ -37,6 +37,15 @@
#include "NanoTime.h"
+#if defined(__APPLE__)
+extern char** environ;
+
+int clearenv() {
+ *environ = nullptr;
+ return 0;
+}
+#endif
+
// Change the slow threshold for these tests since a few can take around
// 20 seconds.
extern "C" bool GetInitialArgs(const char*** args, size_t* num_args) {