add GHC.HetMet.{hetmet_kappa,hetmet_kappa_app}
[ghc-base.git] / cbits / PrelIOUtils.c
1 /* 
2  * (c) The University of Glasgow 2002
3  *
4  * static versions of the inline functions in HsCore.h
5  */
6
7 #define INLINE
8
9 #ifdef __GLASGOW_HASKELL__
10 # include "Rts.h"
11 #endif
12
13 #include "HsBase.h"
14
15 #ifdef __GLASGOW_HASKELL__
16
17 void errorBelch2(const char*s, char *t)
18 {
19     errorBelch(s,t);
20 }
21
22 void debugBelch2(const char*s, char *t)
23 {
24     debugBelch(s,t);
25 }
26
27 #if defined(HAVE_LIBCHARSET)
28 #  include <libcharset.h>
29 #elif defined(HAVE_LANGINFO_H)
30 #  include <langinfo.h>
31 #endif
32
33 #if !defined(mingw32_HOST_OS)
34 const char* localeEncoding(void)
35 {
36 #if defined(HAVE_LIBCHARSET)
37     return locale_charset();
38
39 #elif defined(HAVE_LANGINFO_H)
40     return nl_langinfo(CODESET);
41
42 #else
43 #warning Depending on the unportable behavior of GNU iconv due to absence of both libcharset and langinfo.h
44     /* GNU iconv accepts "" to mean the current locale's
45      * encoding. Warning: This isn't portable.
46      */
47     return "";
48 #endif
49 }
50 #endif
51
52 #endif /* __GLASGOW_HASKELL__ */