Index: native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_glibc.cc |
diff --git a/native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_glibc.cc b/native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_glibc.cc |
index db11423ea340e74236a7be931a4cb027b3e9caec..42e58cc5e1beccc92cbde2a6b04fa12c4907b0a0 100644 |
--- a/native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_glibc.cc |
+++ b/native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_glibc.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-glibc build. |
+#if defined(__native_client__) && defined(__GLIBC__) |
+ |
#include "nacl_mounts/kernel_wrap.h" |
#include <alloca.h> |
#include <dirent.h> |
@@ -14,6 +20,7 @@ |
#include <sys/stat.h> |
#include "nacl_mounts/kernel_intercept.h" |
+ |
namespace { |
void stat_to_nacl_stat(const struct stat* buf, nacl_abi_stat* nacl_buf) { |
@@ -275,3 +282,5 @@ static struct NaClMountsStaticInitializer { |
DO_WRAP(write); |
} |
} nacl_mounts_static_initializer; |
+ |
+#endif // defined(__native_client__) && defined(__GLIBC__) |