diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-06-20 12:14:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-20 12:14:31 -0700 |
| commit | 338232bff7144c6a0e7964984765f01d9f9eecb7 (patch) | |
| tree | e62d8f184bf04df0906fcc6c8a04803febe35376 /source/slangc | |
| parent | 40617db15d87ece6e7cc88da23f747f8f827c69a (diff) | |
| parent | 327f2b7ec50a7480b458d6d3ba8e2ca7fcdb8498 (diff) | |
Merge pull request #36 from tfoleyNV/entry-point-indexing
Overhaul handling of entry points and translation units.
Diffstat (limited to 'source/slangc')
| -rw-r--r-- | source/slangc/main.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/source/slangc/main.cpp b/source/slangc/main.cpp index 06f004531..4a783a17c 100644 --- a/source/slangc/main.cpp +++ b/source/slangc/main.cpp @@ -12,7 +12,7 @@ using namespace Slang; static void diagnosticCallback( char const* message, - void* userData) + void* /*userData*/) { fputs(message, stderr); fflush(stderr); @@ -89,29 +89,36 @@ int MAIN(int argc, char** argv) } #endif -#ifdef _MSC_VER - _CrtDumpMemoryLeaks(); -#endif return 0; } #ifdef _WIN32 int wmain(int argc, wchar_t** argv) { - // Conver the wide-character Unicode arguments to UTF-8, - // since that is what Slang expects on the API side. + int result = 0; - List<String> args; - for(int ii = 0; ii < argc; ++ii) - { - args.Add(String::FromWString(argv[ii])); - } - List<char const*> argBuffers; - for(int ii = 0; ii < argc; ++ii) { - argBuffers.Add(args[ii].Buffer()); + // Conver the wide-character Unicode arguments to UTF-8, + // since that is what Slang expects on the API side. + + List<String> args; + for(int ii = 0; ii < argc; ++ii) + { + args.Add(String::FromWString(argv[ii])); + } + List<char const*> argBuffers; + for(int ii = 0; ii < argc; ++ii) + { + argBuffers.Add(args[ii].Buffer()); + } + + result = MAIN(argc, (char**) &argBuffers[0]); } - return MAIN(argc, (char**) &argBuffers[0]); +#ifdef _MSC_VER + _CrtDumpMemoryLeaks(); +#endif + + return result; } #endif |
