27 #define STRINGIFY_(x) #x
28 #define STRINGIFY(x) STRINGIFY_(x)
30 #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
31 #define KVI_CAST_FUNC __FUNCTION__
33 #define KVI_CAST_FUNC __func__
36 #define KVI_DYNAMIC(expr, expr2) \
37 KviCast::dynamic<expr>(expr2, \
38 __FILE__ ":" STRINGIFY(__LINE__), \
44 template <
typename T,
typename P>
45 T
dynamic(P
p,
const char * file,
const char * func,
const char * expr)
47 T newPointer =
dynamic_cast<T
>(
p);
51 if(newPointer ==
nullptr)
53 qDebug(
"KviCast::dynamic: Conversion from %s to %s failed: %s in %s (%s).",
54 typeid(P).
name(),
typeid(T).
name(), func, file, expr);
#define KVI_ASSERT(__condition__)
GNUC
Definition: kvi_debug.h:138
T dynamic(P p, const char *file, const char *func, const char *expr)
Definition: KviCaster.h:45
QString name()
Definition: KviRuntimeInfo.cpp:655
#define p
Definition: detector.cpp:80