Calling varargs functions is explicitly deprecated according to the
FFI specification. It used to work, just about, but it broke with the
recent changes to the via-C backend to not use header files.
withCString msg $ \cmsg ->
errorBelch cfmt cmsg
-foreign import ccall unsafe "RtsMessages.h errorBelch"
+-- don't use errorBelch() directly, because we cannot call varargs functions
+-- using the FFI.
+foreign import ccall unsafe "HsBase.h errorBelch2"
errorBelch :: CString -> CString -> IO ()
setUncaughtExceptionHandler :: (Exception -> IO ()) -> IO ()
withCString msg $ \cmsg ->
debugBelch cfmt cmsg
-foreign import ccall unsafe "RtsMessages.h debugBelch"
+-- don't use debugBelch() directly, because we cannot call varargs functions
+-- using the FFI.
+foreign import ccall unsafe "HsBase.h debugBelch2"
debugBelch :: CString -> CString -> IO ()
#endif
#define INLINE
#include "HsBase.h"
+void errorBelch2(const char*s, char *t)
+{
+ return errorBelch(s,t);
+}
+
+void debugBelch2(const char*s, char *t)
+{
+ return debugBelch(s,t);
+}
INLINE uintptr_t __hscore_to_uintptr (void *p) { return (uintptr_t)p; }
INLINE intptr_t __hscore_to_intptr (void *p) { return (intptr_t)p; }
+void errorBelch2(const char*s, char *t);
+void debugBelch2(const char*s, char *t);
+
#endif /* __HSBASE_H__ */