mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +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;
|
||||
};
|
||||
|
||||
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
|
||||
struct DirectNativeDesc
|
||||
{
|
||||
|
@ -582,17 +595,7 @@ struct DirectNativeDesc
|
|||
#undef TP
|
||||
#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"); }
|
||||
|
||||
// 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; };
|
||||
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"); }
|
||||
|
||||
operator void *() const { return Ptr; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue