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

Commit

Permalink
applying old change for Win98 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
complexmath committed Sep 8, 2011
1 parent ae8e4a1 commit b23be8d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/rt/dmain2.d
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ version (Windows)
{
private import core.stdc.wchar_;

extern (Windows) uint GetVersion();
extern (Windows) alias int function() FARPROC;
extern (Windows) FARPROC GetProcAddress(void*, in char*);
extern (Windows) void* LoadLibraryA(in char*);
Expand All @@ -37,6 +38,16 @@ version (Windows)
extern (Windows) wchar_t** CommandLineToArgvW(wchar_t*, int*);
extern (Windows) export int WideCharToMultiByte(uint, uint, wchar_t*, int, char*, int, char*, int);
pragma(lib, "shell32.lib"); // needed for CommandLineToArgvW

wchar_t** doCommandLineToArgvW(wchar_t* cmdLine, int* numArgs)
{
if (GetVersion() < 0x80000000)
{
return CommandLineToArgvW(cmdLine, numArgs);
}
// TODO: Handle this manually for Win98 and earlier.
return CommandLineToArgvW(cmdLine, numArgs);
}
}

version (all)
Expand Down

0 comments on commit b23be8d

Please sign in to comment.