Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 32a020e

Browse files
authored
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.
1 parent 8cdcdf1 commit 32a020e

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

src/pal/src/exception/seh-unwind.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Module Name:
2626
#include "pal/context.h"
2727
#include "pal.h"
2828
#include <dlfcn.h>
29-
#include <exception>
30-
29+
3130
#if HAVE_LIBUNWIND_H
3231
#ifndef __linux__
3332
#define UNW_LOCAL_ONLY

src/pal/src/exception/seh.cpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,37 @@ Module Name:
3939
#include <unistd.h>
4040
#include <pthread.h>
4141
#include <stdlib.h>
42-
#include <utility>
42+
43+
// Define the std::move so that we don't have to include the <utility> header
44+
// which on some platforms pulls in STL stuff that collides with PAL stuff.
45+
// The std::move is needed to enable using move constructor and assignment operator
46+
// for PAL_SEHException.
47+
namespace std
48+
{
49+
template<typename T>
50+
struct remove_reference
51+
{
52+
typedef T type;
53+
};
54+
55+
template<typename T>
56+
struct remove_reference<T&>
57+
{
58+
typedef T type;
59+
};
60+
61+
template<typename T>
62+
struct remove_reference<T&&>
63+
{
64+
typedef T type;
65+
};
66+
67+
template<class T> inline
68+
typename remove_reference<T>::type&& move(T&& arg)
69+
{ // forward arg as movable
70+
return ((typename remove_reference<T>::type&&)arg);
71+
}
72+
}
4373

4474
using namespace CorUnix;
4575

0 commit comments

Comments
 (0)