[Folly] define _CRT_INTERNAL_NONSTDC_NAMES to 0 to disable non-underscore posix names on windows (#6974)

This commit is contained in:
Phoebe 2019-06-21 05:13:53 +08:00 committed by Phil Christensen
parent f0902b3537
commit 83520dbc36
3 changed files with 29 additions and 1 deletions

View File

@ -1,5 +1,5 @@
Source: folly
Version: 2019.05.20.00
Version: 2019.05.20.00-1
Homepage: https://github.com/facebook/folly
Description: An open-source C++ library developed and used at Facebook. The library is UNSTABLE on Windows
Build-Depends: openssl, libevent, double-conversion, glog, gflags, boost-chrono, boost-context, boost-conversion, boost-crc, boost-date-time, boost-filesystem, boost-multi-index, boost-program-options, boost-regex, boost-system, boost-thread, boost-smart-ptr

View File

@ -0,0 +1,27 @@
diff --git a/folly/portability/Windows.h b/folly/portability/Windows.h
index f7990ca..b22fac5 100644
--- a/folly/portability/Windows.h
+++ b/folly/portability/Windows.h
@@ -26,16 +26,12 @@
// These have to be this way because we define our own versions
// of close(), because the normal Windows versions don't handle
// sockets at all.
-#ifndef __STDC__
-/* nolint */
-#define __STDC__ 1
-#include <direct.h> // @manual nolint
-#include <io.h> // @manual nolint
-#undef __STDC__
-#else
-#include <direct.h> // @manual nolint
-#include <io.h> // @manual nolint
-#endif
+#include <corecrt.h>
+#pragma push_macro("_CRT_INTERNAL_NONSTDC_NAMES")
+#define _CRT_INTERNAL_NONSTDC_NAMES 0
+#include <direct.h>
+#include <io.h>
+#pragma pop_macro("_CRT_INTERNAL_NONSTDC_NAMES")
#if defined(min) || defined(max)
#error Windows.h needs to be included by this header, or else NOMINMAX needs \

View File

@ -21,6 +21,7 @@ vcpkg_from_github(
missing-include-atomic.patch
boost-1.70.patch
reorder-glog-gflags.patch
disable-non-underscore-posix-names.patch
)
file(COPY