summaryrefslogtreecommitdiff
path: root/rts/RtsSymbols.h
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2017-02-23 18:33:15 -0500
committerBen Gamari <ben@smart-cactus.org>2017-02-26 10:54:07 -0500
commit9968502d075e3a714913e14cd96a7d6b7ac7b5e7 (patch)
tree3fcd4536554af3028a083995affe2510d92ca700 /rts/RtsSymbols.h
parent41e54b4b1a2934364759edcf77ba1f5b03a4098f (diff)
downloadhaskell-9968502d075e3a714913e14cd96a7d6b7ac7b5e7.tar.gz
Make list of deprecated symbols on Windows weak.
We have a unfortunate workaround in place for the fact that most packages out there use POSIX names for symbols even on Windows. This means that we have to recognize e.g. both `_ungetch` and `ungetch`. The former is the actual symbol name on windows and the latter is the POSIX variant. The problem is that on normal windows programs `ungetch` should not be in the global namespace. To work around this, we now mark the deprecated symbols as weak symbols in the global namespace. This provides the flexibility we need: * If you use the symbol without defining it, we assume you meant to use the POSIX variant. * If you actually define the symbol, we'll hence forth use that definition and assume you didn't mean to use POSIX code. This is how MingW64's wrapper also works. This requires D3028. Fixes #13210. Test Plan: ./validate Reviewers: austin, bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3154
Diffstat (limited to 'rts/RtsSymbols.h')
-rw-r--r--rts/RtsSymbols.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/rts/RtsSymbols.h b/rts/RtsSymbols.h
index dab2373ac6..7f7ac0fce6 100644
--- a/rts/RtsSymbols.h
+++ b/rts/RtsSymbols.h
@@ -11,6 +11,7 @@
#include "ghcautoconf.h"
#include "LinkerInternals.h"
+#include <stdbool.h>
#ifdef LEADING_UNDERSCORE
#define MAYBE_LEADING_UNDERSCORE_STR(s) ("_" s)
@@ -21,6 +22,7 @@
typedef struct _RtsSymbolVal {
const SymbolName* lbl;
SymbolAddr* addr;
+ bool weak;
} RtsSymbolVal;
extern RtsSymbolVal rtsSyms[];