mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-01 12:50:42 +00:00
- gcc/clang didn't like having this in a class
This commit is contained in:
parent
ae44b936eb
commit
14919f49ec
1 changed files with 14 additions and 11 deletions
|
@ -561,6 +561,19 @@ struct FieldDesc
|
||||||
int BitValue;
|
int BitValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
// Traits for the types we are interested in
|
||||||
|
template<typename T> struct native_is_valid { static const bool value = false; };
|
||||||
|
template<typename T> struct native_is_valid<T*> { static const bool value = true; };
|
||||||
|
template<typename T> struct native_is_valid<T&> { static const bool value = true; };
|
||||||
|
template<> struct native_is_valid<void> { static const bool value = true; };
|
||||||
|
template<> struct native_is_valid<int> { static const bool value = true; };
|
||||||
|
template<> struct native_is_valid<unsigned int> { static const bool value = true; };
|
||||||
|
template<> struct native_is_valid<double> { static const bool value = true; };
|
||||||
|
template<> struct native_is_valid<bool> { static const bool value = true; };
|
||||||
|
}
|
||||||
|
|
||||||
// Compile time validation of direct native functions
|
// Compile time validation of direct native functions
|
||||||
struct DirectNativeDesc
|
struct DirectNativeDesc
|
||||||
{
|
{
|
||||||
|
@ -582,17 +595,7 @@ struct DirectNativeDesc
|
||||||
#undef TP
|
#undef TP
|
||||||
#undef VP
|
#undef VP
|
||||||
|
|
||||||
template<typename T> void ValidateType() { static_assert(is_valid<T>::value, "Argument type is not valid as a direct native parameter or return type"); }
|
template<typename T> void ValidateType() { static_assert(native_is_valid<T>::value, "Argument type is not valid as a direct native parameter or return type"); }
|
||||||
|
|
||||||
// Traits for the types we are interested in
|
|
||||||
template<typename T> struct is_valid { static const bool value = false; };
|
|
||||||
template<typename T> struct is_valid<T*> { static const bool value = true; };
|
|
||||||
template<typename T> struct is_valid<T&> { static const bool value = true; };
|
|
||||||
template<> struct is_valid<void> { static const bool value = true; };
|
|
||||||
template<> struct is_valid<int> { static const bool value = true; };
|
|
||||||
template<> struct is_valid<unsigned int> { static const bool value = true; };
|
|
||||||
template<> struct is_valid<double> { static const bool value = true; };
|
|
||||||
template<> struct is_valid<bool> { static const bool value = true; };
|
|
||||||
|
|
||||||
operator void *() const { return Ptr; }
|
operator void *() const { return Ptr; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue