aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhoebe <925731795@qq.com>2019-06-21 05:13:53 +0800
committerPhil Christensen <philc@microsoft.com>2019-06-20 14:13:53 -0700
commit83520dbc36e644951829f1a94fe47395314d9a4c (patch)
treed526b772fe5eb28451103f457a0ab19751ff754c
parentf0902b35370fbebcf257de88e43ee47379185a10 (diff)
downloadvcpkg-83520dbc36e644951829f1a94fe47395314d9a4c.tar.gz
vcpkg-83520dbc36e644951829f1a94fe47395314d9a4c.zip
[Folly] define _CRT_INTERNAL_NONSTDC_NAMES to 0 to disable non-underscore posix names on windows (#6974)
-rw-r--r--ports/folly/CONTROL2
-rw-r--r--ports/folly/disable-non-underscore-posix-names.patch27
-rw-r--r--ports/folly/portfile.cmake1
3 files changed, 29 insertions, 1 deletions
diff --git a/ports/folly/CONTROL b/ports/folly/CONTROL
index 1709a4515..268039ac7 100644
--- a/ports/folly/CONTROL
+++ b/ports/folly/CONTROL
@@ -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
diff --git a/ports/folly/disable-non-underscore-posix-names.patch b/ports/folly/disable-non-underscore-posix-names.patch
new file mode 100644
index 000000000..bbe79481c
--- /dev/null
+++ b/ports/folly/disable-non-underscore-posix-names.patch
@@ -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 \
diff --git a/ports/folly/portfile.cmake b/ports/folly/portfile.cmake
index 7e7f40565..abf32aa99 100644
--- a/ports/folly/portfile.cmake
+++ b/ports/folly/portfile.cmake
@@ -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