projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Export Unicode and newline functionality from System.IO; update Haddock docs
[ghc-base.git]
/
cbits
/
PrelIOUtils.c
diff --git
a/cbits/PrelIOUtils.c
b/cbits/PrelIOUtils.c
index
cf74a8e
..
6444bd0
100644
(file)
--- a/
cbits/PrelIOUtils.c
+++ b/
cbits/PrelIOUtils.c
@@
-5,9
+5,15
@@
*/
#define INLINE
*/
#define INLINE
+
+#ifdef __GLASGOW_HASKELL__
+# include "Rts.h"
+#endif
+
#include "HsBase.h"
#include "HsBase.h"
-#include "Stg.h"
-#include "RtsMessages.h"
+
+#ifdef __GLASGOW_HASKELL__
+# include "RtsMessages.h"
void errorBelch2(const char*s, char *t)
{
void errorBelch2(const char*s, char *t)
{
@@
-18,3
+24,14
@@
void debugBelch2(const char*s, char *t)
{
debugBelch(s,t);
}
{
debugBelch(s,t);
}
+
+// Use a C wrapper for this because we avoid hsc2hs in base
+#if HAVE_LANGINFO_H
+#include <langinfo.h>
+char *localeEncoding (void)
+{
+ return nl_langinfo(CODESET);
+}
+#endif
+
+#endif /* __GLASGOW_HASKELL__ */