Handle leading underscores correctly, for ghci on Win32.
\begin{code}
{-# OPTIONS -#include "Linker.h" #-}
+
+-- so that we can see defn of LEADING_UNDERSCORE
+#include "../includes/config.h"
+
module Linker (
initLinker, -- :: IO ()
loadObj, -- :: String -> IO ()
-- RTS Linker Interface
-- ---------------------------------------------------------------------------
-lookupSymbol str = do
+lookupSymbol str_in = do
+# ifdef LEADING_UNDERSCORE
+ let str = '_':str_in
+# else
+ let str = str_in
+# endif
addr <- c_lookupSymbol (packString str)
if addr == nullPtr
then return Nothing