[PATCH] D26431: [WebAssembly] Define __unix__ as part of the wasm target

Jacob Gravelle via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 8 16:14:43 PST 2016


jgravelle-google created this revision.
jgravelle-google added reviewers: dschuff, sunfish.
jgravelle-google added a subscriber: cfe-commits.
Herald added a subscriber: jfb.

Unix is a convenient common denominator for embeddings to implement
syscalls for. This makes it explicit that wasm is unix-y


https://reviews.llvm.org/D26431

Files:
  lib/Basic/Targets.cpp


Index: lib/Basic/Targets.cpp
===================================================================
--- lib/Basic/Targets.cpp
+++ lib/Basic/Targets.cpp
@@ -856,6 +856,8 @@
     // Follow g++ convention and predefine _GNU_SOURCE for C++.
     if (Opts.CPlusPlus)
       Builder.defineMacro("_GNU_SOURCE");
+
+    DefineStd(Builder, "unix", Opts);
   }
 
   // As an optimization, group static init code together in a section.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26431.77282.patch
Type: text/x-patch
Size: 422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161109/c66bac8e/attachment.bin>


More information about the cfe-commits mailing list