Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: native_client_sdk/src/libraries/nacl_mounts/kernel_wrap_glibc.cc

Issue 11744010: [NaCl SDK] Change the kernel_wrap OS #ifdefs in nacl_mounts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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__)

Powered by Google App Engine
This is Rietveld 408576698