__PIP_TYPENAME_DECLARE
This commit is contained in:
@@ -231,7 +231,36 @@ extern char ** environ;
|
||||
# if PIP_HAS_RTTI
|
||||
# define __PIP_TYPENAME__(T) typeid(T).name()
|
||||
# else
|
||||
# define __PIP_TYPENAME__(T) "?"
|
||||
template<typename T>
|
||||
inline const char * __pip_typename__() {
|
||||
static_assert(false, "this type must declare typename via __PIP_TYPENAME_DECLARE");
|
||||
return "?";
|
||||
}
|
||||
|
||||
# define __PIP_TYPENAME_DECLARE(T, NAME) \
|
||||
template<> \
|
||||
inline const char * __pip_typename__<T>() { \
|
||||
return NAME; \
|
||||
}
|
||||
|
||||
__PIP_TYPENAME_DECLARE(bool, "bool")
|
||||
__PIP_TYPENAME_DECLARE(char, "char")
|
||||
__PIP_TYPENAME_DECLARE(signed char, "signed char")
|
||||
__PIP_TYPENAME_DECLARE(unsigned char, "unsigned char")
|
||||
__PIP_TYPENAME_DECLARE(short, "short")
|
||||
__PIP_TYPENAME_DECLARE(unsigned short, "unsigned short")
|
||||
__PIP_TYPENAME_DECLARE(int, "int")
|
||||
__PIP_TYPENAME_DECLARE(unsigned int, "unsigned int")
|
||||
__PIP_TYPENAME_DECLARE(long, "long")
|
||||
__PIP_TYPENAME_DECLARE(unsigned long, "unsigned long")
|
||||
__PIP_TYPENAME_DECLARE(long long, "long long")
|
||||
__PIP_TYPENAME_DECLARE(unsigned long long, "unsigned long long")
|
||||
__PIP_TYPENAME_DECLARE(float, "float")
|
||||
__PIP_TYPENAME_DECLARE(double, "double")
|
||||
__PIP_TYPENAME_DECLARE(long double, "long double")
|
||||
__PIP_TYPENAME_DECLARE(void, "void")
|
||||
|
||||
# define __PIP_TYPENAME__(T) __pip_typename__<T>()
|
||||
# endif
|
||||
|
||||
# ifdef CC_GCC
|
||||
|
||||
Reference in New Issue
Block a user