1 /* 2 Copyright (c) 2008-2009 NetAllied Systems GmbH 3 4 This file is part of COLLADASaxFrameworkLoader. 5 6 Licensed under the MIT Open Source License, 7 for details please see LICENSE file or the website 8 http://www.opensource.org/licenses/mit-license.php 9 */ 10 11 #ifndef __COLLADASAXFWL_PREREQUISITES_H__ 12 #define __COLLADASAXFWL_PREREQUISITES_H__ 13 14 #include <cstddef> 15 #include <limits> 16 17 #include <string> 18 #include <cassert> 19 #include "COLLADABUPlatform.h" 20 21 namespace COLLADASaxFWL 22 { 23 typedef std::string String; 24 25 26 enum COLLADAVersion 27 { 28 COLLADA_UNKNOWN, 29 COLLADA_14, 30 COLLADA_15 31 }; 32 33 34 #define COLLADASAXFWL_REAL_IS_FLOAT 35 36 #ifdef COLLADASAXFWL_REAL_IS_FLOAT 37 typedef float Real; 38 #else 39 typedef float Double; 40 #endif 41 42 } 43 44 45 #ifndef NDEBUG 46 // Uncomment this line, if you want to check, that the sax parser functions are virtual functions of the base class 47 // This a only a compile time check. Comment this line if you want to run the frame work loader; 48 # define MakeVirtualFunctionTest 49 #endif //NDEBUG 50 51 // This macro should be used in every reimplementation of one of the virtual functions of ColladaParserAutoGen 52 // When MakeVirtualFunctionTest is defined, this macro checks, if this function exist as a method in ColladaParserAutoGen 53 // The parameter is the name of the function, i.e. every reimplementation of a class called C should looke like: 54 // C::begin__elementName( SaxVirtualFunctionTest(begin__elementName) .... ) 55 // 56 #ifdef MakeVirtualFunctionTest 57 # define SaxVirtualFunctionTest14(f) if (false) static_cast<ColladaParserAutoGen14*>(this)->f; 58 #else 59 # define SaxVirtualFunctionTest14(f) 60 #endif //MakeVirtualFunctionTest 61 62 #ifdef MakeVirtualFunctionTest 63 # define SaxVirtualFunctionTest15(f) if (false) static_cast<ColladaParserAutoGen15*>(this)->f; 64 #else 65 # define SaxVirtualFunctionTest15(f) 66 #endif //MakeVirtualFunctionTest 67 68 69 70 #endif //__COLLADASAXFWL_PREREQUISITES_H__ 71