Browse Source

* Fix wide string shared library loading by adding 'lib' prefix if needed

git-svn-id: trunk@20568 -
pierre 13 years ago
parent
commit
ff5d25174a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      rtl/unix/cwstring.pp

+ 5 - 1
rtl/unix/cwstring.pp

@@ -47,14 +47,18 @@ Uses
 Const
 Const
 {$ifndef useiconv}
 {$ifndef useiconv}
     libiconvname='c';  // is in libc under Linux.
     libiconvname='c';  // is in libc under Linux.
+    libprefix='lib';
 {$else}
 {$else}
   {$ifdef haiku}
   {$ifdef haiku}
     libiconvname='textencoding';  // is in libtextencoding under Haiku
     libiconvname='textencoding';  // is in libtextencoding under Haiku
+    libprefix='lib';
   {$else}
   {$else}
     {$ifdef darwin}
     {$ifdef darwin}
       libiconvname='libiconv';
       libiconvname='libiconv';
+      libprefix='';
     {$else}
     {$else}
       libiconvname='iconv';
       libiconvname='iconv';
+      libprefix='lib';
     {$endif}
     {$endif}
   {$endif}
   {$endif}
 {$endif}
 {$endif}
@@ -978,7 +982,7 @@ initialization
   setlocale(LC_ALL,'');
   setlocale(LC_ALL,'');
 
 
   { load iconvctl function }
   { load iconvctl function }
-  iconvlib:=LoadLibrary(libiconvname+'.'+SharedSuffix);
+  iconvlib:=LoadLibrary(libprefix+libiconvname+'.'+SharedSuffix);
   if iconvlib<>0 then
   if iconvlib<>0 then
     pointer(iconvctl):=GetProcAddress(iconvlib,iconvctlname);
     pointer(iconvctl):=GetProcAddress(iconvlib,iconvctlname);