Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit c54593d

Browse files
authored
Merge pull request #2425 from rainers/issue19498
fix issue 19498 - undefined identifier rt_loadLibraryW merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2 parents f828e46 + 9f504a4 commit c54593d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/core/runtime.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ else version (WatchOS)
2121

2222
/// C interface for Runtime.loadLibrary
2323
extern (C) void* rt_loadLibrary(const char* name);
24+
/// ditto
25+
version (Windows) extern (C) void* rt_loadLibraryW(const wchar* name);
2426

2527
/// C interface for Runtime.unloadLibrary, returns 1/0 instead of bool
2628
extern (C) int rt_unloadLibrary(void* ptr);

test/shared/src/loadlibwin.d

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// https://issues.dlang.org/show_bug.cgi?id=19498
2+
void main()
3+
{
4+
import core.runtime;
5+
auto kernel32 = Runtime.loadLibrary("kernel32.dll");
6+
assert(kernel32);
7+
Runtime.unloadLibrary(kernel32);
8+
}

win64.mak

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ test_hash:
105105
test_stdcpp:
106106
$(MAKE) -f test\stdcpp\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
107107

108-
test_all: test_uuid test_aa test_hash test_stdcpp
108+
test_loadlib:
109+
$(DMD) -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIME) -run test\shared\src\loadlibwin.d
110+
111+
test_all: test_uuid test_aa test_hash test_stdcpp test_loadlib
109112

110113
################### zip/install/clean ##########################
111114

0 commit comments

Comments
 (0)