From 3ea3a41d2ab68f0394ae2dd4a33b2370906e09f6 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Tue, 9 Mar 2010 09:58:14 +0000 Subject: [PATCH] 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 - --- packages/iconvenc/src/iconvenc.pas | 2 +- rtl/unix/cwstring.pp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/iconvenc/src/iconvenc.pas b/packages/iconvenc/src/iconvenc.pas index e90ace9e5d..e0aac343c5 100644 --- a/packages/iconvenc/src/iconvenc.pas +++ b/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=''; diff --git a/rtl/unix/cwstring.pp b/rtl/unix/cwstring.pp index be698189b0..ee29ddc77d 100644 --- a/rtl/unix/cwstring.pp +++ b/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...}