diff --git a/System/Console/Haskeline/Backend/IConv.hsc b/System/Console/Haskeline/Backend/IConv.hsc
index f972606ec3f6bfd286dd931619cd01838dd7e867..b6f3585e938de80737615c1ff2a7533f54d9259b 100644
--- a/System/Console/Haskeline/Backend/IConv.hsc
+++ b/System/Console/Haskeline/Backend/IConv.hsc
@@ -87,7 +87,7 @@ getCodeset = do
 type IConvT = ForeignPtr ()
 type IConvTPtr = Ptr ()
 
-foreign import ccall "h_iconv_open" iconv_open
+foreign import ccall "haskeline_iconv_open" iconv_open
     :: CString -> CString -> IO IConvTPtr
 
 iconvOpen :: String -> String -> IO IConvT
@@ -101,9 +101,9 @@ iconvOpen destName srcName = withCAString destName $ \dest ->
                                     else newForeignPtr iconv_close res
 
 -- really this returns a CInt, but it's easiest to just ignore that, I think.
-foreign import ccall "& h_iconv_close" iconv_close :: FunPtr (IConvTPtr -> IO ())
+foreign import ccall "& haskeline_iconv_close" iconv_close :: FunPtr (IConvTPtr -> IO ())
 
-foreign import ccall "h_iconv" c_iconv :: IConvTPtr -> Ptr CString -> Ptr CSize
+foreign import ccall "haskeline_iconv" c_iconv :: IConvTPtr -> Ptr CString -> Ptr CSize
                             -> Ptr CString -> Ptr CSize -> IO CSize
 
 data Result = Successful
diff --git a/System/Console/Haskeline/Backend/WCWidth.hs b/System/Console/Haskeline/Backend/WCWidth.hs
index f06a1654031cf3ed41633756f7083c4e82516449..be7ae3fe57958a2df40bc26251fcc896d5fde462 100644
--- a/System/Console/Haskeline/Backend/WCWidth.hs
+++ b/System/Console/Haskeline/Backend/WCWidth.hs
@@ -13,10 +13,10 @@ import System.Console.Haskeline.LineState
 import Data.List
 import Foreign.C.Types
 
-foreign import ccall unsafe mk_wcwidth :: CWchar -> CInt
+foreign import ccall unsafe haskeline_mk_wcwidth :: CWchar -> CInt
 
 wcwidth :: Char -> Int
-wcwidth c = case mk_wcwidth $ toEnum $ fromEnum c of
+wcwidth c = case haskeline_mk_wcwidth $ toEnum $ fromEnum c of
                 -1 -> 0 -- Control characters have zero width.  (Used by the
                         -- "\SOH...\STX" hack in LineState.stringToGraphemes.)
                 w -> fromIntegral w
diff --git a/System/Console/Haskeline/Backend/Win32.hsc b/System/Console/Haskeline/Backend/Win32.hsc
index 4f6ae98473a7e480798eae67800c205b462ed370..36d6f858ac781f75d4752f7c37853f143d34b202 100644
--- a/System/Console/Haskeline/Backend/Win32.hsc
+++ b/System/Console/Haskeline/Backend/Win32.hsc
@@ -171,7 +171,7 @@ instance Storable Coord where
         (#poke COORD, Y) p (toEnum (coordY c) :: CShort)
                 
                             
-foreign import ccall "SetPosition"
+foreign import ccall "haskeline_SetPosition"
     c_SetPosition :: HANDLE -> Ptr Coord -> IO Bool
     
 setPosition :: HANDLE -> Coord -> IO ()
diff --git a/cbits/h_iconv.c b/cbits/h_iconv.c
index 71234c8e5f30c4ccd5e0526d90ab260c75938398..7f8e17a494cfeefac5996164346a3030e94fe803 100644
--- a/cbits/h_iconv.c
+++ b/cbits/h_iconv.c
@@ -1,15 +1,15 @@
 #include "h_iconv.h"
 
 // Wrapper functions, since iconv_open et al are macros in libiconv.
-iconv_t h_iconv_open(const char *tocode, const char *fromcode) {
+iconv_t haskeline_iconv_open(const char *tocode, const char *fromcode) {
     return iconv_open(tocode, fromcode);
 }
 
-void h_iconv_close(iconv_t cd) {
+void haskeline_iconv_close(iconv_t cd) {
     iconv_close(cd);
 }
 
-size_t h_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft,
+size_t haskeline_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft,
                 char **outbuf, size_t *outbytesleft) {
     // Cast inbuf to (void*) so that it works both on Solaris, which expects
     // a (const char**), and on other platforms (e.g. Linux), which expect
diff --git a/cbits/h_wcwidth.c b/cbits/h_wcwidth.c
index 61e822ad679f7c7c9cc819f5bb24ac4b13a7fbf0..b4ca5484ae077727203aa9ddd4a07372c0c7e152 100644
--- a/cbits/h_wcwidth.c
+++ b/cbits/h_wcwidth.c
@@ -67,7 +67,7 @@ struct interval {
 };
 
 /* auxiliary function for binary search in interval table */
-static int bisearch(wchar_t ucs, const struct interval *table, int max) {
+static int haskeline_bisearch(wchar_t ucs, const struct interval *table, int max) {
   int min = 0;
   int mid;
 
@@ -119,7 +119,7 @@ static int bisearch(wchar_t ucs, const struct interval *table, int max) {
  * in ISO 10646.
  */
 
-int mk_wcwidth(wchar_t ucs)
+int haskeline_mk_wcwidth(wchar_t ucs)
 {
   /* sorted list of non-overlapping intervals of non-spacing characters */
   /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */
@@ -181,7 +181,7 @@ int mk_wcwidth(wchar_t ucs)
     return -1;
 
   /* binary search in table of non-spacing characters */
-  if (bisearch(ucs, combining,
+  if (haskeline_bisearch(ucs, combining,
 	       sizeof(combining) / sizeof(struct interval) - 1))
     return 0;
 
@@ -204,12 +204,12 @@ int mk_wcwidth(wchar_t ucs)
 }
 
 
-int mk_wcswidth(const wchar_t *pwcs, size_t n)
+int haskeline_mk_wcswidth(const wchar_t *pwcs, size_t n)
 {
   int w, width = 0;
 
   for (;*pwcs && n-- > 0; pwcs++)
-    if ((w = mk_wcwidth(*pwcs)) < 0)
+    if ((w = haskeline_mk_wcwidth(*pwcs)) < 0)
       return -1;
     else
       width += w;
@@ -227,7 +227,7 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n)
  * the traditional terminal character-width behaviour. It is not
  * otherwise recommended for general use.
  */
-int mk_wcwidth_cjk(wchar_t ucs)
+int haskeline_mk_wcwidth_cjk(wchar_t ucs)
 {
   /* sorted list of non-overlapping intervals of East Asian Ambiguous
    * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
@@ -287,20 +287,20 @@ int mk_wcwidth_cjk(wchar_t ucs)
   };
 
   /* binary search in table of non-spacing characters */
-  if (bisearch(ucs, ambiguous,
+  if (haskeline_bisearch(ucs, ambiguous,
 	       sizeof(ambiguous) / sizeof(struct interval) - 1))
     return 2;
 
-  return mk_wcwidth(ucs);
+  return haskeline_mk_wcwidth(ucs);
 }
 
 
-int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
+int haskeline_mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
 {
   int w, width = 0;
 
   for (;*pwcs && n-- > 0; pwcs++)
-    if ((w = mk_wcwidth_cjk(*pwcs)) < 0)
+    if ((w = haskeline_mk_wcwidth_cjk(*pwcs)) < 0)
       return -1;
     else
       width += w;
diff --git a/cbits/win_console.c b/cbits/win_console.c
index 74df387ed44f33334db7cc292cca79ec8552f90c..c8ae01a8fb84866085ef9875aa5b61654a650d33 100644
--- a/cbits/win_console.c
+++ b/cbits/win_console.c
@@ -1,5 +1,5 @@
 #include "win_console.h"
 
-BOOL SetPosition(HANDLE h, COORD* c) {
+BOOL haskeline_SetPosition(HANDLE h, COORD* c) {
     return SetConsoleCursorPosition(h,*c);
 }
diff --git a/includes/h_iconv.h b/includes/h_iconv.h
index 9022381136028ae89af0020d181683a9684fe0c9..b4a88c391f6e3c2e380a14d8c65b7606751f4867 100644
--- a/includes/h_iconv.h
+++ b/includes/h_iconv.h
@@ -1,9 +1,9 @@
 #include <iconv.h>
 
-iconv_t h_iconv_open(const char *tocode, const char *fromcode);
+iconv_t haskeline_iconv_open(const char *tocode, const char *fromcode);
 
-void h_iconv_close(iconv_t cd);
+void haskeline_iconv_close(iconv_t cd);
 
-size_t h_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft,
+size_t haskeline_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft,
                 char **outbuf, size_t *outbytesleft);
 
diff --git a/includes/win_console.h b/includes/win_console.h
index bccd3b784e47b9f25be921a5a7ed9e85cd663b13..cfe24a2a05c75fd997cc0c6bf1cde04162365d51 100644
--- a/includes/win_console.h
+++ b/includes/win_console.h
@@ -2,6 +2,6 @@
 #define _WIN_CONSOLE_H
 #include <windows.h>
 
-BOOL SetPosition(HANDLE h, COORD* c);
+BOOL haskeline_SetPosition(HANDLE h, COORD* c);
 
 #endif