2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2007 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
11 #ifndef CORE__TAGUA_CAST_H
12 #define CORE__TAGUA_CAST_H
16 #define CAT_AUX(x, y) x ## y
17 #define CAT(x, y) CAT_AUX(x, y)
20 #define TAGUA_CAST(ID, TYPE, RETVAL) \
21 TYPE* ID = dynamic_cast<TYPE*>(CAT(ID, _)); \
23 kWarning("Mismatch!!"); \
27 #define TAGUA_CAST(ID, TYPE, RETVAL) \
28 TYPE* ID = static_cast<TYPE*>(CAT(ID, _));
31 #endif // CORE__TAGUA_CAST_H