Skip to content

Commit 441f720

Browse files
committed
Support unsigned long values for Dynamic
Fixes ambiguous calls when compiling with Xcode
1 parent 00985d5 commit 441f720

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

include/Dynamic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
3030
Dynamic(float inVal);
3131
Dynamic(cpp::Int64 inVal);
3232
Dynamic(cpp::UInt64 inVal);
33+
Dynamic(unsigned long inVal);
3334
Dynamic(hx::Object *inObj) : super(inObj) { }
3435
Dynamic(const String &inString);
3536
Dynamic(const null &inNull) : super(0) { }
@@ -74,6 +75,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES Dynamic : public hx::ObjectPtr<hx::Object>
7475
inline operator bool() const { return mPtr && mPtr->__ToInt(); }
7576
inline operator cpp::Int64() const { return mPtr ? mPtr->__ToInt64() : 0; }
7677
inline operator cpp::UInt64() const { return mPtr ? mPtr->__ToInt64() : 0; }
78+
inline operator unsigned long() const { return mPtr ? mPtr->__ToInt64() : 0; }
7779

7880
// Conversion to generic pointer requires you to tag the class with a typedef
7981
template<typename T>

include/cpp/Variant.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ namespace cpp
7070

7171
inline Variant(cpp::Int64 inValue) : type(typeInt64), valInt64(inValue) { }
7272
inline Variant(cpp::UInt64 inValue) : type(typeInt64), valInt64(inValue) { }
73+
inline Variant(unsigned long inValue) : type(typeInt64), valInt64(inValue) { }
7374
inline Variant(int inValue) : type(typeInt), valInt(inValue) { }
7475
inline Variant(cpp::UInt32 inValue) : type(typeInt), valInt(inValue) { }
7576
inline Variant(cpp::Int16 inValue) : type(typeInt), valInt(inValue) { }
@@ -111,6 +112,7 @@ namespace cpp
111112
inline operator signed char () const { return asInt(); }
112113
inline operator cpp::Int64 () const { return asInt64(); }
113114
inline operator cpp::UInt64 () const { return asInt64(); }
115+
inline operator unsigned long () const { return asInt64(); }
114116
inline bool operator !() const { return !asInt(); }
115117

116118
inline int Compare(hx::Object *inRHS) const;

include/hxString.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES String
9595
String(const float &inRHS);
9696
String(const cpp::Int64 &inRHS);
9797
String(const cpp::UInt64 &inRHS);
98+
String(const unsigned long &inRHS);
9899
explicit String(const bool &inRHS);
99100
inline String(const null &inRHS) : __s(0), length(0) { }
100101
String(hx::Null< ::String > inRHS) : __s(inRHS.value.__s), length(inRHS.value.length) { }

include/null.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class null
9292
operator signed char () { return 0; }
9393
operator short () { return 0; }
9494
operator unsigned short () { return 0; }
95+
operator unsigned long () { return 0; }
9596
operator cpp::UInt64 () { return 0; }
9697
operator cpp::Int64 () { return 0; }
9798
template<typename T>

0 commit comments

Comments
 (0)