Skip to content

Commit 2c52a04

Browse files
[MERGE chakra-core#896] cross platform: fixes output message for ch
Merge pull request chakra-core#896 from obastemur:fix_ch_text
2 parents ddd3e0b + 3e332a7 commit 2c52a04

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

bin/ch/ChakraRtInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void UnloadChakraCore(HINSTANCE module)
3535

3636
void* GetChakraCoreSymbol(HINSTANCE module, const char* symbol)
3737
{
38-
return GetProcAddress(module, symbol);
38+
return reinterpret_cast<void*>(GetProcAddress(module, symbol));
3939
}
4040

4141
/*static*/

bin/ch/ch.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77

88
unsigned int MessageBase::s_messageCount = 0;
99

10+
#ifdef _WIN32
1011
LPCWSTR hostName = _u("ch.exe");
12+
#else
13+
LPCWSTR hostName = _u("ch");
14+
#endif
1115

1216
extern "C"
1317
HRESULT __stdcall OnChakraCoreLoadedEntry(TestHooks& testHooks)
@@ -121,17 +125,17 @@ int HostExceptionFilter(int exceptionCode, _EXCEPTION_POINTERS *ep)
121125

122126
void __stdcall PrintUsageFormat()
123127
{
124-
wprintf(_u("\nUsage: ch.exe [flaglist] filename\n"));
128+
wprintf(_u("\nUsage: %s [flaglist] <source file>\n"), hostName);
125129
}
126130

127131
void __stdcall PrintUsage()
128132
{
129-
#ifndef DEBUG
130-
wprintf(_u("\nUsage: ch.exe filename")
131-
_u("\n[flaglist] is not supported for Release mode\n"));
133+
#if !defined(DEBUG) || !defined(_WIN32)
134+
wprintf(_u("\nUsage: %s <source file> %s"), hostName,
135+
_u("\n[flaglist] is only supported for debug builds on Windows\n"));
132136
#else
133137
PrintUsageFormat();
134-
wprintf(_u("Try 'ch.exe -?' for help\n"));
138+
wprintf(_u("Try '%s -?' for help\n"), hostName);
135139
#endif
136140
}
137141

0 commit comments

Comments
 (0)