[PATCH] D28223: clean up use of _WIN32

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 02:24:20 PST 2017


EricWF added inline comments.


================
Comment at: include/__config:158
+#if defined(_WIN32)
+#  define _LIBCPP_WIN32         1
 #  define _LIBCPP_LITTLE_ENDIAN 1
----------------
smeenai wrote:
> Perhaps `_LIBCPP_WIN32API` instead, to be clear that this is specific to the usage of Win32 APIs, rather than just a general catch-all libc++ on Windows macro?
+1 for that name, since it is self documenting.


================
Comment at: include/__config:791
 // Most unix variants have catopen.  These are the specific ones that don't.
-#if !defined(_WIN32) && !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
+#if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
 #define _LIBCPP_HAS_CATOPEN 1
----------------
smeenai wrote:
> Windows has `catopen`?
This is nested in a block that already excludes windows.


================
Comment at: include/type_traits:1684
 // PE/COFF does not support alignment beyond 8192 (=0x2000)
-#if !defined(_WIN32)
+#if !defined(__ELF__) && !defined(__MACH__)
 _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000);
----------------
smeenai wrote:
> Might be cleaner to have a `_LIBCPP_COFF` macro (both here and for the similar `__config` change), to make the intent clearer?
+1 for `_LIBCPP_COFF` or similar. I would rather explicitly exclude coff than include a list of supported formats.


================
Comment at: src/thread.cpp:27
 
-#if !defined(_WIN32)
+#if defined(__unix__) || defined(__APPLE__)
 # include <unistd.h>
----------------
I wonder if the drivers on solaris define `__unix__`. 


Repository:
  rL LLVM

https://reviews.llvm.org/D28223





More information about the cfe-commits mailing list