X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=cbits%2FPrelIOUtils.c;h=b910c28de2bbce25c9c9db21d73d3a7debaad009;hb=4dc0a6fa50f56444c76e84387a16b179df2549ee;hp=412c8b875fc215608f41bb35add31f02cffc4439;hpb=d704979eea6b9a723af54958c8463319b578638a;p=ghc-base.git diff --git a/cbits/PrelIOUtils.c b/cbits/PrelIOUtils.c index 412c8b8..b910c28 100644 --- a/cbits/PrelIOUtils.c +++ b/cbits/PrelIOUtils.c @@ -5,8 +5,15 @@ */ #define INLINE + +#ifdef __GLASGOW_HASKELL__ +# include "Rts.h" +#endif + #include "HsBase.h" +#ifdef __GLASGOW_HASKELL__ + void errorBelch2(const char*s, char *t) { errorBelch(s,t); @@ -16,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 +char *localeEncoding (void) +{ + return nl_langinfo(CODESET); +} +#endif + +#endif /* __GLASGOW_HASKELL__ */