export hGetBufSome (#4046)
[ghc-base.git] / cbits / PrelIOUtils.c
index cf74a8e..b910c28 100644 (file)
@@ -5,9 +5,14 @@
  */
 
 #define INLINE
+
+#ifdef __GLASGOW_HASKELL__
+# include "Rts.h"
+#endif
+
 #include "HsBase.h"
-#include "Stg.h"
-#include "RtsMessages.h"
+
+#ifdef __GLASGOW_HASKELL__
 
 void errorBelch2(const char*s, char *t)
 {
@@ -18,3 +23,14 @@ void debugBelch2(const char*s, char *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__ */