Index: native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_newlib.cc |
diff --git a/native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_newlib.cc b/native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_newlib.cc |
index d4cb61869c267824f35eda965a727105f94ffc8f..57cbdb34feb0463ce90558c815c80533113a1ae2 100644 |
--- a/native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_newlib.cc |
+++ b/native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_newlib.cc |
@@ -3,6 +3,12 @@ |
* found in the LICENSE file. |
*/ |
+#include <sys/types.h> // Include something that will define __GLIBC__. |
+ |
+// The entire file is wrapped in this #if. We do this so this .cc file can be |
+// compiled, even on a non-newlib build. |
+#if defined(__native_client__) && !defined(__GLIBC__) |
+ |
#include "nacl_mounts/kernel_wrap.h" |
#include <dirent.h> |
#include <errno.h> |
@@ -161,3 +167,5 @@ static struct NaClMountsStaticInitializer { |
DO_WRAP(filename, stat); |
} |
} nacl_mounts_static_initializer; |
+ |
+#endif // defined(__native_client__) && !defined(__GLIBC__) |