summaryrefslogtreecommitdiff
path: root/rtl/unix
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-07-22 21:45:34 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-07-22 21:45:34 +0000
commita0bde9cee3eddc254ffd6048a222211974a47495 (patch)
treee7473bfd82167b759ef76a4077bbe5c2f40de59d /rtl/unix
parent6f1d2daec18d8659add4e92a3e97821151e51317 (diff)
downloadfpc-a0bde9cee3eddc254ffd6048a222211974a47495.tar.gz
+ defaultfilesystemcodepage support for dynlibs
+ unicodestring overloads for (safe)loadlibrary() git-svn-id: http://svn.freepascal.org/svn/fpc/branches/cpstrrtl@25162 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/unix')
-rw-r--r--rtl/unix/dynlibs.inc14
1 files changed, 8 insertions, 6 deletions
diff --git a/rtl/unix/dynlibs.inc b/rtl/unix/dynlibs.inc
index 4b39af3e49..a324a5fad6 100644
--- a/rtl/unix/dynlibs.inc
+++ b/rtl/unix/dynlibs.inc
@@ -42,24 +42,26 @@ Const
uses dl;
-Function LoadLibrary(const Name : AnsiString) : TLibHandle;
+Function DoLoadLibrary(const Name : RawByteString) : TLibHandle;
{$ifdef aix}
var
- MemberName: AnsiString;
+ MemberName: RawByteString;
{$endif}
begin
{$ifndef aix}
- Result:=TLibHandle(dlopen(Pchar(Name),RTLD_LAZY));
+ Result:=TLibHandle(dlopen(PAnsiChar(Name),RTLD_LAZY));
{$else aix}
{ in aix, most shared libraries are static libraries (archives) that contain
a single object: shr.o for 32 bit, shr_64.o for 64 bit. You have to specify
this object file explicitly via the RTLD_MEMBER member flag }
{$ifdef cpu64}
- MemberName:=Name+'(shr_64.o)';
+ MemberName:='(shr_64.o)';
{$else cpu64}
- MemberName:=Name+'(shr.o)';
+ MemberName:='(shr.o)';
{$endif cpu64}
- Result:=TLibHandle(dlopen(Pchar(MemberName),RTLD_LAZY or RTLD_MEMBER));
+ SetCodePage(MemberName,DefaultFileSystemCodePage,false);
+ MemberName:=Name+MemberName;
+ Result:=TLibHandle(dlopen(PAnsiChar(MemberName),RTLD_LAZY or RTLD_MEMBER));
{$endif aix}
end;