Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4f8687

Browse files
committed
Make previous BadCast change optional.
1 parent 7cdf32e commit a4f8687

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

Changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
* Reverted change that automatically threw 'BadCast'. Now required HXCPP_STRICT_CASTS
23
------------------------------------------------------------
34
* Cached dynamic versions of small ints and 1-char-strings for speed
45
* Added support for weak hashes - needs latest haxe version

include/hx/Object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ class ObjectPtr
191191
inline ObjectPtr(const ObjectPtr<SOURCE_> &inObjectPtr)
192192
{
193193
if (!SetPtr(inObjectPtr.mPtr))
194+
#ifdef HXCPP_STRICT_CASTS
194195
CastPtr(inObjectPtr.mPtr,true);
196+
#else
197+
CastPtr(inObjectPtr.mPtr,false);
198+
#endif
195199
}
196200

197201
template<typename SOURCE_>

toolchain/common-defines.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<flag value="-I${dll_import_include}" if="dll_import_include"/>
1919
<flag value="-DHXCPP_DLL_EXPORT" if="dll_export"/>
2020
<flag value="-DHXCPP_SCRIPTABLE" if="scriptable"/>
21+
<flag value="-DHXCPP_STRICT_CASTS" if="HXCPP_STRICT_CASTS"/>
2122
<flag value='-DHXCPP_DEBUG_HOST="${HXCPP_DEBUG_HOST}"' if="HXCPP_DEBUG_HOST" />
2223
<flag value='-DHXCPP_API_LEVEL=${removeQuotes:hxcpp_api_level}' if="hxcpp_api_level" />
2324
<flag value='-DHXCPP_API_LEVEL=0' unless="hxcpp_api_level" />

0 commit comments

Comments
 (0)