Skip to content

Commit 7a9d40c

Browse files
committed
[MERGE #2351 @leirocks] some swb fixes needed for full
Merge pull request #2351 from leirocks:wbmerge
2 parents a8db2b3 + e6a14fe commit 7a9d40c

File tree

94 files changed

+7191
-6920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+7191
-6920
lines changed

bin/External/catch.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,8 +1571,8 @@ std::string toString( std::string const& value );
15711571
std::string toString( std::wstring const& value );
15721572
std::string toString( const char* const value );
15731573
std::string toString( char* const value );
1574-
std::string toString( const wchar_t* const value );
1575-
std::string toString( wchar_t* const value );
1574+
std::string toString( const WCHAR* const value );
1575+
std::string toString( WCHAR* const value );
15761576
std::string toString( int value );
15771577
std::string toString( unsigned long value );
15781578
std::string toString( unsigned int value );
@@ -8095,14 +8095,14 @@ std::string toString( char* const value ) {
80958095
return Catch::toString( static_cast<const char*>( value ) );
80968096
}
80978097

8098-
std::string toString( const wchar_t* const value )
8098+
std::string toString( const WCHAR* const value )
80998099
{
81008100
return value ? Catch::toString( std::wstring(value) ) : std::string( "{null string}" );
81018101
}
81028102

8103-
std::string toString( wchar_t* const value )
8103+
std::string toString( WCHAR* const value )
81048104
{
8105-
return Catch::toString( static_cast<const wchar_t*>( value ) );
8105+
return Catch::toString( static_cast<const WCHAR*>( value ) );
81068106
}
81078107

81088108
std::string toString( int value ) {
@@ -10506,4 +10506,3 @@ int main (int argc, char * const argv[]) {
1050610506
using Catch::Detail::Approx;
1050710507

1050810508
#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
10509-

bin/NativeTests/JsRTApiTest.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ namespace JsRTApiTest
108108
REQUIRE(JsCreateObject(&object) == JsNoError);
109109

110110
JsPropertyIdRef name1 = JS_INVALID_REFERENCE;
111-
const wchar_t* name = nullptr;
111+
const WCHAR* name = nullptr;
112112
REQUIRE(JsGetPropertyIdFromName(_u("stringProperty1"), &name1) == JsNoError);
113113
REQUIRE(JsGetPropertyNameFromId(name1, &name) == JsNoError);
114114
CHECK(!wcscmp(name, _u("stringProperty1")));
@@ -582,7 +582,7 @@ namespace JsRTApiTest
582582
JsValueRef CALLBACK ExternalFunctionPreScriptAbortionCallback(JsValueRef /* function */, bool /* isConstructCall */, JsValueRef * args /* args */, USHORT /* cargs */, void * /* callbackState */)
583583
{
584584
JsValueRef result = JS_INVALID_REFERENCE;
585-
const wchar_t *scriptText = nullptr;
585+
const WCHAR *scriptText = nullptr;
586586
size_t scriptTextLen;
587587

588588
REQUIRE(JsStringToPointer(args[0], &scriptText, &scriptTextLen) == JsNoError);
@@ -593,7 +593,7 @@ namespace JsRTApiTest
593593
JsValueRef CALLBACK ExternalFunctionPostScriptAbortionCallback(JsValueRef /* function */, bool /* isConstructCall */, JsValueRef * args /* args */, USHORT /* cargs */, void * /* callbackState */)
594594
{
595595
JsValueRef result = JS_INVALID_REFERENCE;
596-
const wchar_t *scriptText = nullptr;
596+
const WCHAR *scriptText = nullptr;
597597
size_t scriptTextLen;
598598

599599
REQUIRE(JsStringToPointer(args[0], &scriptText, &scriptTextLen) == JsNoError);
@@ -656,7 +656,7 @@ namespace JsRTApiTest
656656
REQUIRE(JsCreateFunction(ExternalFunctionCallback, nullptr, &function) == JsNoError);
657657
testConstructorName(function, _u(""), 0);
658658

659-
wchar_t name[] = _u("FooName");
659+
WCHAR name[] = _u("FooName");
660660
JsValueRef nameString = JS_INVALID_REFERENCE;
661661
REQUIRE(JsPointerToString(name, _countof(name) - 1, &nameString) == JsNoError);
662662
REQUIRE(JsCreateNamedFunction(nameString, ExternalFunctionCallback, nullptr, &function) == JsNoError);
@@ -688,7 +688,7 @@ namespace JsRTApiTest
688688

689689
JsValueRef args[] = { GetUndefined() };
690690

691-
// throw from script, handle in host
691+
// throw from script, handle in host
692692
REQUIRE(JsGetPropertyIdFromName(_u("throwAtHost"), &name) == JsNoError);
693693
REQUIRE(JsGetProperty(global, name, &function) == JsNoError);
694694
REQUIRE(JsCallFunction(function, args, _countof(args), &result) == JsErrorScriptException);
@@ -701,12 +701,12 @@ namespace JsRTApiTest
701701
REQUIRE(JsGetPropertyIdFromName(_u("callHost"), &name) == JsNoError);
702702
REQUIRE(JsSetProperty(global, name, result, true) == JsNoError);
703703

704-
// throw from host callback, catch in script
704+
// throw from host callback, catch in script
705705
REQUIRE(JsGetPropertyIdFromName(_u("callHostWithTryCatch"), &name) == JsNoError);
706706
REQUIRE(JsGetProperty(global, name, &function) == JsNoError);
707707
REQUIRE(JsCallFunction(function, args, _countof(args), &result) == JsNoError);
708708

709-
// throw from host callback, through script, handle in host
709+
// throw from host callback, through script, handle in host
710710
REQUIRE(JsGetPropertyIdFromName(_u("callHostWithNoTryCatch"), &name) == JsNoError);
711711
REQUIRE(JsGetProperty(global, name, &function) == JsNoError);
712712
REQUIRE(JsCallFunction(function, args, _countof(args), &result) == JsErrorScriptException);
@@ -855,7 +855,7 @@ namespace JsRTApiTest
855855
JsValueRef nameValue = JS_INVALID_REFERENCE;
856856
REQUIRE(JsGetIndexedProperty(propertyNames, indexValue, &nameValue) == JsNoError);
857857

858-
const wchar_t *name = nullptr;
858+
const WCHAR *name = nullptr;
859859
size_t length;
860860
REQUIRE(JsStringToPointer(nameValue, &name, &length) == JsNoError);
861861

@@ -879,7 +879,7 @@ namespace JsRTApiTest
879879
JsPropertyIdRef propertyId = JS_INVALID_REFERENCE;
880880
JsValueRef outValue = JS_INVALID_REFERENCE;
881881
JsValueRef propertySymbols = JS_INVALID_REFERENCE;
882-
const wchar_t* name = nullptr;
882+
const WCHAR* name = nullptr;
883883
JsPropertyIdType propertyIdType;
884884

885885
REQUIRE(JsCreateObject(&object) == JsNoError);
@@ -1003,7 +1003,7 @@ namespace JsRTApiTest
10031003
bool boolValue;
10041004
BYTE *compiledScript = nullptr;
10051005
unsigned int scriptSize = 0;
1006-
const wchar_t *stringValue;
1006+
const WCHAR *stringValue;
10071007
size_t stringLength;
10081008
ByteCodeCallbackTracker tracker = {};
10091009

@@ -1030,7 +1030,7 @@ namespace JsRTApiTest
10301030

10311031
tracker.script = script;
10321032
REQUIRE(JsRunSerializedScriptWithCallback(
1033-
[](JsSourceContext sourceContext, const wchar_t** scriptBuffer)
1033+
[](JsSourceContext sourceContext, const WCHAR** scriptBuffer)
10341034
{
10351035
((ByteCodeCallbackTracker*)sourceContext)->loadedScript = true;
10361036
*scriptBuffer = ((ByteCodeCallbackTracker*)sourceContext)->script;
@@ -1079,7 +1079,7 @@ namespace JsRTApiTest
10791079
REQUIRE(oldProtect == PAGE_READWRITE);
10801080
tracker.script = scriptFnToString;
10811081
REQUIRE(JsRunSerializedScriptWithCallback(
1082-
[](JsSourceContext sourceContext, const wchar_t** scriptBuffer)
1082+
[](JsSourceContext sourceContext, const WCHAR** scriptBuffer)
10831083
{
10841084
((ByteCodeCallbackTracker*)sourceContext)->loadedScript = true;
10851085
*scriptBuffer = ((ByteCodeCallbackTracker*)sourceContext)->script;
@@ -1619,7 +1619,7 @@ namespace JsRTApiTest
16191619
REQUIRE(JsCreateFunction(ExternalFunctionPostScriptAbortionCallback, nullptr, &postScriptAbortFunction) == JsNoError);
16201620
JsValueRef scriptTextArg = JS_INVALID_REFERENCE;
16211621

1622-
wchar_t *scriptText = const_cast<wchar_t *>(terminationTests[i]);
1622+
WCHAR *scriptText = const_cast<WCHAR *>(terminationTests[i]);
16231623
REQUIRE(JsPointerToString(scriptText, wcslen(scriptText), &scriptTextArg) == JsNoError);
16241624
JsValueRef args[] = { scriptTextArg };
16251625

bin/ch/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ target_include_directories (ch
3535
if(STATIC_LIBRARY)
3636
if(CC_TARGET_OS_ANDROID OR CC_TARGET_OS_LINUX)
3737
set(LINKER_START_GROUP -pie -Wl,--start-group)
38-
set(LINKER_END_GROUP -Wl,--end-group -static-libstdc++)
38+
set(LINKER_END_GROUP -Wl,--end-group)
39+
if (CC_TARGET_OS_LINUX) # do not embed libstdc++ statically on Android
40+
set(LINKER_END_GROUP "${LINKER_END_GROUP} -static-libstdc++")
41+
else()
42+
set(LINKER_END_GROUP "${LINKER_END_GROUP} -llog")
43+
endif()
3944
elseif(CC_TARGET_OS_OSX)
4045
set(LINKER_START_GROUP -Wl,-force_load,)
4146
endif()

0 commit comments

Comments
 (0)