/* * StdInc.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ #pragma once #include "../Global.h" #include #include //no i/o just types #include #include #include #include template inline const T * dynamic_ptr_cast(const F * ptr) { #ifndef __APPLE__ return dynamic_cast(ptr); #else if (!strcmp(typeid(*ptr).name(), typeid(T).name())) { return static_cast(ptr); } return nullptr; #endif } template inline T * dynamic_ptr_cast(F * ptr) { #ifndef __APPLE__ return dynamic_cast(ptr); #else if (!strcmp(typeid(*ptr).name(), typeid(T).name())) { return static_cast(ptr); } return nullptr; #endif }