174 |
|
|
175 |
|
implementation |
176 |
|
|
177 |
< |
uses Sysutils, IB, Dynlibs |
177 |
> |
uses Sysutils, IB, Dynlibs, Classes |
178 |
|
{$IFDEF WINDOWS} |
179 |
|
,Forms, Registry |
180 |
|
{$ENDIF} |
192 |
|
raise Exception.Create('Unable to load Firebird Client Library'); |
193 |
|
end; |
194 |
|
{$IFDEF UNIX } |
195 |
+ |
function FindLibrary(LibNameList: string): TLibHandle; |
196 |
+ |
var LibNames: TStringList; |
197 |
+ |
i: integer; |
198 |
+ |
begin |
199 |
+ |
Result := NilHandle; |
200 |
+ |
LibNames := TStringList.Create; |
201 |
+ |
try |
202 |
+ |
LibNames.Delimiter := ':'; |
203 |
+ |
LibNames.StrictDelimiter := true; |
204 |
+ |
LibNames.DelimitedText := LibNameList; {Split list on semi-colon} |
205 |
+ |
for i := 0 to LibNames.Count - 1 do |
206 |
+ |
begin |
207 |
+ |
Result := LoadLibrary(LibNames[i]); |
208 |
+ |
if Result <> NilHandle then Exit; |
209 |
+ |
end; |
210 |
+ |
finally |
211 |
+ |
LibNames.Free; |
212 |
+ |
end; |
213 |
+ |
end; |
214 |
+ |
|
215 |
|
function InternalLoadLibrary: TLibHandle; |
216 |
|
var LibName: string; |
217 |
|
begin |
224 |
|
else |
225 |
|
LibName := FIREBIRD_SO2; |
226 |
|
end; |
227 |
< |
Result := LoadLibrary(LibName); |
227 |
> |
Result := FindLibrary(LibName); |
228 |
|
{$IFDEF DARWIN} |
229 |
|
if Result = NilHandle then |
230 |
|
begin |