瀏覽代碼

o patch from Olivier for Haiku libiconv functionality (mantis #15906):
* Haiku's nl_langinfo implementation is now used under Haiku instead of
the BeOS stub.
* Fix linking to iconv in the iconvenc package. The prefix has change
since the previous Haiku's version.

git-svn-id: trunk@14995 -

Jonas Maebe 15 年之前
父節點
當前提交
3ea3a41d2a
共有 2 個文件被更改,包括 10 次插入4 次删除
  1. 1 1
      packages/iconvenc/src/iconvenc.pas
  2. 9 3
      rtl/unix/cwstring.pp

+ 1 - 1
packages/iconvenc/src/iconvenc.pas

@@ -59,7 +59,7 @@ Const
   {$endif}
 {$endif}
 
-{$if defined(darwin) and defined(cpupowerpc32)}
+{$if (defined(darwin) and defined(cpupowerpc32)) or defined(haiku)}
   iconvprefix='lib';  
 {$else}
   iconvprefix='';

+ 9 - 3
rtl/unix/cwstring.pp

@@ -29,6 +29,7 @@ implementation
 {$if not defined(linux) and not defined(solaris)}  // Linux (and maybe glibc platforms in general), have iconv in glibc.
  {$if defined(haiku)}
    {$linklib textencoding}
+   {$linklib locale}
  {$else}
    {$linklib iconv}
  {$endif}
@@ -132,8 +133,13 @@ type
   piconv_t = ^iconv_t;
   iconv_t = pointer;
   nl_item = cint;
-{$ifndef beos}
-function nl_langinfo(__item:nl_item):pchar;cdecl;external libiconvname name 'nl_langinfo';
+
+{$ifdef haiku}
+  function nl_langinfo(__item:nl_item):pchar;cdecl;external 'locale' name 'nl_langinfo';
+{$else}
+  {$ifndef beos}
+  function nl_langinfo(__item:nl_item):pchar;cdecl;external libiconvname name 'nl_langinfo';
+  {$endif}
 {$endif}
 
 {$if (not defined(bsd) and not defined(beos)) or (defined(darwin) and not defined(cpupowerpc32))}
@@ -153,7 +159,7 @@ threadvar
   iconv_ansi2wide,
   iconv_wide2ansi : iconv_t;
 
-{$ifdef beos}
+{$if defined(beos) and not defined(haiku)}
 function nl_langinfo(__item:nl_item):pchar;
 begin
   {$warning TODO BeOS nl_langinfo or more uptodate port of iconv...}