digitalmars.D - rdmd.exe doesn't compile on windows
- ollie (34/34) Jan 29 2013 rdmd.exe stopped compiling on Windows a couple of days ago with the
- Andrej Mitrovic (7/10) Jan 29 2013 For the "A" versions you can simply use toStringz, and D string
- Rainer Schuetze (3/13) Jan 29 2013 To be pedantic, both toUTFz and toStringz are wrong, the A functions
- Dmitry Olshansky (5/25) Jan 29 2013 ... that's why you always have to convert to UTF-16 use *W version that
rdmd.exe stopped compiling on Windows a couple of days ago with the following error: rdmd.d(93): Error: function rdmd.ShellExecuteA (void*, const(char)*, const (char)*, const(char)*, const(char)*, int) is not callable using argument types (typeof(null),string,const(immutable(char)[]),typeof(null),typeof (null),int)rdmd.d(93): Error: cannot implicitly convert expression (page) of type const(immutable(char)[]) to const(char)* Could someone who is more fluent in the bug process apply this fix (Or one the would be more correct). Thanks, Ollie diff --git a/rdmd.d b/rdmd.d index fb5a3ce..d9f5f79 100644 --- a/rdmd.d +++ b/rdmd.d -14,6 +14,7 version (Posix) else version (Windows) { import std.c.windows.windows; + import std.utf; extern(Windows) HINSTANCE ShellExecuteA(HWND, LPCSTR, LPCSTR, LPCSTR, LPCSTR, INT); enum objExt = ".obj"; enum binExt = ".exe"; -90,7 +91,7 int main(string[] args) version(Windows) { // invoke browser that is associated with the http protocol - ShellExecuteA(null, "open", page, null, null, SW_SHOWNORMAL); + ShellExecuteA(null, toUTFz!(LPCSTR)("open"), toUTFz!(LPCSTR) (page), null, null, SW_SHOWNORMAL); } else {
Jan 29 2013
On 1/29/13, ollie <ollie home.net> wrote:rdmd.exe stopped compiling on Windows a couple of days ago.Thanks for the report.+ ShellExecuteA(null, toUTFz!(LPCSTR)("open"), toUTFz!(LPCSTR) (page), null, null, SW_SHOWNORMAL);For the "A" versions you can simply use toStringz, and D string literals are zero-appended by default so "open" doesn't have to be changed (note that means only for string literals, not string variables). https://github.com/D-Programming-Language/tools/pull/42
Jan 29 2013
On 29.01.2013 18:19, Andrej Mitrovic wrote:On 1/29/13, ollie <ollie home.net> wrote:To be pedantic, both toUTFz and toStringz are wrong, the A functions expect toMBSz() to get at least some non-ASCII characters right.rdmd.exe stopped compiling on Windows a couple of days ago.Thanks for the report.+ ShellExecuteA(null, toUTFz!(LPCSTR)("open"), toUTFz!(LPCSTR) (page), null, null, SW_SHOWNORMAL);For the "A" versions you can simply use toStringz, and D string literals are zero-appended by default so "open" doesn't have to be changed (note that means only for string literals, not string variables). https://github.com/D-Programming-Language/tools/pull/42
Jan 29 2013
29-Jan-2013 21:44, Rainer Schuetze пишет:On 29.01.2013 18:19, Andrej Mitrovic wrote:... that's why you always have to convert to UTF-16 use *W version that understands Unicode. -- Dmitry OlshanskyOn 1/29/13, ollie <ollie home.net> wrote:To be pedantic, both toUTFz and toStringz are wrong, the A functions expect toMBSz() to get at least some non-ASCII characters right.rdmd.exe stopped compiling on Windows a couple of days ago.Thanks for the report.+ ShellExecuteA(null, toUTFz!(LPCSTR)("open"), toUTFz!(LPCSTR) (page), null, null, SW_SHOWNORMAL);For the "A" versions you can simply use toStringz, and D string literals are zero-appended by default so "open" doesn't have to be changed (note that means only for string literals, not string variables). https://github.com/D-Programming-Language/tools/pull/42
Jan 29 2013