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

Commit aa4be02

Browse files
authored
Merge pull request #2392 from WalterBright/runtime-WCHAR
core/runtime.d: use WCHAR to interface to Windows merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2 parents 118e298 + f4abe84 commit aa4be02

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/core/runtime.d

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@
44
* Copyright: Copyright Sean Kelly 2005 - 2009.
55
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
66
* Authors: Sean Kelly
7-
* Source: $(DRUNTIMESRC core/_runtime.d)
7+
* Source: $(LINK2 https://github.com/dlang/druntime/blob/master/src/core/runtime.d, _runtime.d)
8+
* Documentation: https://dlang.org/phobos/core_runtime.html
89
*/
910

10-
/* Copyright Sean Kelly 2005 - 2009.
11-
* Distributed under the Boost Software License, Version 1.0.
12-
* (See accompanying file LICENSE or copy at
13-
* http://www.boost.org/LICENSE_1_0.txt)
14-
*/
1511
module core.runtime;
1612

17-
version (Windows) import core.stdc.wchar_ : wchar_t;
18-
1913
version (OSX)
2014
version = Darwin;
2115
else version (iOS)
@@ -27,8 +21,7 @@ else version (WatchOS)
2721

2822
/// C interface for Runtime.loadLibrary
2923
extern (C) void* rt_loadLibrary(const char* name);
30-
/// ditto
31-
version (Windows) extern (C) void* rt_loadLibraryW(const wchar_t* name);
24+
3225
/// C interface for Runtime.unloadLibrary, returns 1/0 instead of bool
3326
extern (C) int rt_unloadLibrary(void* ptr);
3427

@@ -243,7 +236,7 @@ struct Runtime
243236
if (len == 0)
244237
return null;
245238

246-
auto buf = cast(wchar_t*)malloc((len+1) * wchar_t.sizeof);
239+
auto buf = cast(WCHAR*)malloc((len+1) * WCHAR.sizeof);
247240
if (buf is null) return null;
248241
scope (exit) free(buf);
249242

0 commit comments

Comments
 (0)