diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2017-10-03 22:09:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-03 22:09:43 +0200 |
commit | 08d39ddf02c81c99bd49c19b808c855235cbabdc (patch) | |
tree | f1314991120946c183cd58490db9219cbce596ca /src/pal/src/init | |
parent | 4cfd557c2d1e80123d5a37aaea00636ddcc7be49 (diff) | |
download | coreclr-08d39ddf02c81c99bd49c19b808c855235cbabdc.tar.gz coreclr-08d39ddf02c81c99bd49c19b808c855235cbabdc.tar.bz2 coreclr-08d39ddf02c81c99bd49c19b808c855235cbabdc.zip |
Fix build with latest Xcode on OSX (#14282)
* Fix build with latest Xcode on OSX
The latest Xcode 9 cannot successfully build CoreCLR PAL. There are
several issues. First, it complains that min / max macros cannot be defined
in C++ code, since they would collide with the std::min and std::max
functions. Second, some of the headers that PAL includes pull in declarations
of several template classes that we explicitly define in PAL and also
the new operator declaration.
To fix that, I have undefined the min and max macros for PAL and replaced
their usage by the std::min / max functions. I have also removed the manual
declaration of the colliding template classes and new operator and added
inclusion of the proper C++ headers instead.
The PAL was including non-pal safemath.h and to make this change compatible
with it, I have added definition of USE_STL that makes safemath.h include
type_trait from STL instead of our local trimmed copy.
I have also removed some dead code that I have discovered during the process.
Fixes #14279
* Fix build on ARM32 and very recent GLIBCXX
Diffstat (limited to 'src/pal/src/init')
-rw-r--r-- | src/pal/src/init/pal.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pal/src/init/pal.cpp b/src/pal/src/init/pal.cpp index 37c1677f38..996292e2c4 100644 --- a/src/pal/src/init/pal.cpp +++ b/src/pal/src/init/pal.cpp @@ -83,6 +83,8 @@ int CacheLineSize; #include <kvm.h> #endif +#include <algorithm> + using namespace CorUnix; // @@ -218,7 +220,7 @@ InitializeDefaultStackSize() if (errno == 0) { - g_defaultStackSize = max(size, PTHREAD_STACK_MIN); + g_defaultStackSize = std::max(size, (long int)PTHREAD_STACK_MIN); } } |