mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-22 22:49:39 +01:00
* fixed compilation in darwin
git-svn-id: trunk@7868 -
This commit is contained in:
parent
e34bc1f2b0
commit
098b82cdf6
@ -29,7 +29,7 @@ implementation
|
|||||||
{$linklib iconv}
|
{$linklib iconv}
|
||||||
{$endif linux}
|
{$endif linux}
|
||||||
|
|
||||||
Uses
|
Uses
|
||||||
BaseUnix,
|
BaseUnix,
|
||||||
ctypes,
|
ctypes,
|
||||||
unix,
|
unix,
|
||||||
@ -38,13 +38,24 @@ Uses
|
|||||||
initc,
|
initc,
|
||||||
LCLProc;
|
LCLProc;
|
||||||
|
|
||||||
Const
|
const
|
||||||
{$ifdef Linux}
|
{$ifdef Linux}
|
||||||
libiconvname='c'; // is in libc under Linux.
|
libiconvname='c'; // is in libc under Linux.
|
||||||
{$else}
|
{$else}
|
||||||
libiconvname='iconv';
|
libiconvname='iconv';
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
{$ifdef darwin}
|
||||||
|
type
|
||||||
|
// defined in libc, but there the iconv* functions are in the wrong lib
|
||||||
|
// they aren't defind in darwin/ptypes :(
|
||||||
|
size_t = cuint32;
|
||||||
|
psize_t = ^size_t;
|
||||||
|
wint_t = cint32;
|
||||||
|
wchar_t = widechar;
|
||||||
|
pwchar_t = ^wchar_t;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
{ Case-mapping "arrays" }
|
{ Case-mapping "arrays" }
|
||||||
//var
|
//var
|
||||||
// AnsiUpperChars: AnsiString; // 1..255
|
// AnsiUpperChars: AnsiString; // 1..255
|
||||||
@ -68,6 +79,7 @@ const
|
|||||||
{$else linux}
|
{$else linux}
|
||||||
{$ifdef darwin}
|
{$ifdef darwin}
|
||||||
CODESET = 0;
|
CODESET = 0;
|
||||||
|
ESysEILSEQ = 92;
|
||||||
{$else darwin}
|
{$else darwin}
|
||||||
{$ifdef FreeBSD} // actually FreeBSD5. internationalisation is afaik not default on 4.
|
{$ifdef FreeBSD} // actually FreeBSD5. internationalisation is afaik not default on 4.
|
||||||
CODESET = 0;
|
CODESET = 0;
|
||||||
@ -85,21 +97,22 @@ const
|
|||||||
unicode_encoding = 'UNICODEBIG';
|
unicode_encoding = 'UNICODEBIG';
|
||||||
{$endif FPC_LITTLE_ENDIAN}
|
{$endif FPC_LITTLE_ENDIAN}
|
||||||
|
|
||||||
|
{$ifdef darwin}
|
||||||
|
_ICONVSYMPREFIX = 'lib';
|
||||||
|
{$else}
|
||||||
|
_ICONVSYMPREFIX = '';
|
||||||
|
{$endif}
|
||||||
|
|
||||||
type
|
type
|
||||||
piconv_t = ^iconv_t;
|
piconv_t = ^iconv_t;
|
||||||
iconv_t = pointer;
|
iconv_t = pointer;
|
||||||
nl_item = cint;
|
nl_item = cint;
|
||||||
|
|
||||||
|
|
||||||
function nl_langinfo(__item:nl_item):pchar;cdecl;external libiconvname name 'nl_langinfo';
|
function nl_langinfo(__item:nl_item):pchar;cdecl;external libiconvname name 'nl_langinfo';
|
||||||
{$ifndef Darwin}
|
function iconv_open(__tocode:pchar; __fromcode:pchar):iconv_t;cdecl;external libiconvname name _ICONVSYMPREFIX+'iconv_open';
|
||||||
function iconv_open(__tocode:pchar; __fromcode:pchar):iconv_t;cdecl;external libiconvname name 'iconv_open';
|
function iconv(__cd:iconv_t; __inbuf:ppchar; __inbytesleft:psize_t; __outbuf:ppchar; __outbytesleft:psize_t):size_t;cdecl;external libiconvname name _ICONVSYMPREFIX+'iconv';
|
||||||
function iconv(__cd:iconv_t; __inbuf:ppchar; __inbytesleft:psize_t; __outbuf:ppchar; __outbytesleft:psize_t):size_t;cdecl;external libiconvname name 'iconv';
|
function iconv_close(__cd:iconv_t):cint;cdecl;external libiconvname name _ICONVSYMPREFIX+'iconv_close';
|
||||||
function iconv_close(__cd:iconv_t):cint;cdecl;external libiconvname name 'iconv_close';
|
|
||||||
{$else}
|
|
||||||
function iconv_open(__tocode:pchar; __fromcode:pchar):iconv_t;cdecl;external libiconvname name 'libiconv_open';
|
|
||||||
function iconv(__cd:iconv_t; __inbuf:ppchar; __inbytesleft:psize_t; __outbuf:ppchar; __outbytesleft:psize_t):size_t;cdecl;external libiconvname name 'libiconv';
|
|
||||||
function iconv_close(__cd:iconv_t):cint;cdecl;external libiconvname name 'libiconv_close';
|
|
||||||
{$endif}
|
|
||||||
|
|
||||||
var
|
var
|
||||||
iconv_ansi2wide,
|
iconv_ansi2wide,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user