Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dlang
gtkd
Commits
0c4782a5
Commit
0c4782a5
authored
Jun 02, 2019
by
Mike Wey
Browse files
Allow defining more than one name for a library.
parent
74cab047
Changes
2
Hide whitespace changes
Inline
Side-by-side
generated/gtkd/gtkd/Loader.d
View file @
0c4782a5
...
...
@@ -19,6 +19,7 @@
module
gtkd
.
Loader
;
import
std
.
algorithm
:
canFind
;
import
std
.
stdio
;
import
std
.
string
;
...
...
@@ -115,11 +116,21 @@ public struct Linker
*/
public
static
void
loadLibrary
(
string
library
)
{
void
*
handle
=
pLoadLibrary
(
library
)
;
void
*
handle
;
//TODO: A more general way to try more than one version.
if
(
handle
is
null
&&
library
==
importLibs
[
LIBRARY
.
GSV
]
)
handle
=
pLoadLibrary
(
importLibs
[
LIBRARY
.
GSV1
]);
if
(
library
.
canFind
(
';'
)
)
{
foreach
(
lib
;
library
.
split
(
';'
)
)
{
handle
=
pLoadLibrary
(
lib
);
if
(
handle
)
break
;
}
}
else
{
handle
=
pLoadLibrary
(
library
);
}
if
(
handle
is
null
)
throw
new
Exception
(
"Library load failed ("
~
library
~
"): "
~
getErrorMessage
());
...
...
src/gtkd/Loader.d
View file @
0c4782a5
...
...
@@ -19,6 +19,7 @@
module
gtkd
.
Loader
;
import
std
.
algorithm
:
canFind
;
import
std
.
stdio
;
import
std
.
string
;
...
...
@@ -115,11 +116,21 @@ public struct Linker
*/
public
static
void
loadLibrary
(
string
library
)
{
void
*
handle
=
pLoadLibrary
(
library
)
;
void
*
handle
;
//TODO: A more general way to try more than one version.
if
(
handle
is
null
&&
library
==
importLibs
[
LIBRARY
.
GSV
]
)
handle
=
pLoadLibrary
(
importLibs
[
LIBRARY
.
GSV1
]);
if
(
library
.
canFind
(
';'
)
)
{
foreach
(
lib
;
library
.
split
(
';'
)
)
{
handle
=
pLoadLibrary
(
lib
);
if
(
handle
)
break
;
}
}
else
{
handle
=
pLoadLibrary
(
library
);
}
if
(
handle
is
null
)
throw
new
Exception
(
"Library load failed ("
~
library
~
"): "
~
getErrorMessage
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment