summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2016-07-21 02:37:26 +0200
committerGitHub <noreply@github.com>2016-07-21 02:37:26 +0200
commit32a020e47a0797bba4167e85efc38a34397f633e (patch)
tree2b6b05b4bdeda3626d5a26c82251b11dd918e6b2
parent8cdcdf1e8e2ed789c8a689553a384bb6fd1d7bcd (diff)
downloadcoreclr-32a020e47a0797bba4167e85efc38a34397f633e.tar.gz
coreclr-32a020e47a0797bba4167e85efc38a34397f633e.tar.bz2
coreclr-32a020e47a0797bba4167e85efc38a34397f633e.zip
Remove include of <utility> from seh.cpp (#6359)
In my previous change that made exceptions smaller, I had `#include <utility>` and I haven't realized that it pulls in some stl headers. That breaks build on ARM. The fix is to replace that include by defining just the std::move that's all that was needed from the header.
-rw-r--r--src/pal/src/exception/seh-unwind.cpp3
-rw-r--r--src/pal/src/exception/seh.cpp32
2 files changed, 32 insertions, 3 deletions
diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp
index c00be51a5b..24eebbbf94 100644
--- a/src/pal/src/exception/seh-unwind.cpp
+++ b/src/pal/src/exception/seh-unwind.cpp
@@ -26,8 +26,7 @@ Abstract:
#include "pal/context.h"
#include "pal.h"
#include <dlfcn.h>
-#include <exception>
-
+
#if HAVE_LIBUNWIND_H
#ifndef __linux__
#define UNW_LOCAL_ONLY
diff --git a/src/pal/src/exception/seh.cpp b/src/pal/src/exception/seh.cpp
index 5aaa18f65a..5320ecd087 100644
--- a/src/pal/src/exception/seh.cpp
+++ b/src/pal/src/exception/seh.cpp
@@ -39,7 +39,37 @@ Abstract:
#include <unistd.h>
#include <pthread.h>
#include <stdlib.h>
-#include <utility>
+
+// Define the std::move so that we don't have to include the <utility> header
+// which on some platforms pulls in STL stuff that collides with PAL stuff.
+// The std::move is needed to enable using move constructor and assignment operator
+// for PAL_SEHException.
+namespace std
+{
+ template<typename T>
+ struct remove_reference
+ {
+ typedef T type;
+ };
+
+ template<typename T>
+ struct remove_reference<T&>
+ {
+ typedef T type;
+ };
+
+ template<typename T>
+ struct remove_reference<T&&>
+ {
+ typedef T type;
+ };
+
+ template<class T> inline
+ typename remove_reference<T>::type&& move(T&& arg)
+ { // forward arg as movable
+ return ((typename remove_reference<T>::type&&)arg);
+ }
+}
using namespace CorUnix;