[Yake-svn] SF.net SVN: yake: [1633] trunk/yake/yake/base/yakePrerequisites.h
Status: Beta
Brought to you by:
psyclonist
From: <psy...@us...> - 2007-03-12 23:17:00
|
Revision: 1633 http://svn.sourceforge.net/yake/?rev=1633&view=rev Author: psyclonist Date: 2007-03-12 16:17:00 -0700 (Mon, 12 Mar 2007) Log Message: ----------- readd Added Paths: ----------- trunk/yake/yake/base/yakePrerequisites.h Added: trunk/yake/yake/base/yakePrerequisites.h =================================================================== --- trunk/yake/yake/base/yakePrerequisites.h (rev 0) +++ trunk/yake/yake/base/yakePrerequisites.h 2007-03-12 23:17:00 UTC (rev 1633) @@ -0,0 +1,162 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_BASE_PREREQUISITES_H +#define YAKE_BASE_PREREQUISITES_H + +//============================================================================ +// IMPLEMENTATION HEADERS +//=========================================================================== +#include <yake/config.h> +#include <yake/base/yakePlatform.h> +#include <assert.h> +#include <ctime> +#include <math.h> +#include <cmath> +// Undef min and max macros on Windows. They're defined in windef.h. +#if (YAKE_PLATFORM == PLATFORM_WIN32) + #ifdef min + #undef min + #endif + #ifdef max + #undef max + #endif +#endif +#include <limits> +#include <cstdio> +#include <stdio.h> +#include <stdarg.h> +#include <string> +#include <stdexcept> +#include <locale> +#include <algorithm> +#include <functional> +#include <vector> +#include <map> +#include <list> +#include <queue> +#include <set> +#include <iostream> +#include <sstream> + +#ifdef __SGI_STL +# include <iterator> +#endif + +// Include platform specific configuration files +#if (YAKE_PLATFORM == PLATFORM_WIN32) && (YAKE_COMPILER == COMPILER_MSVC) +# include <yake/base/prerequisites/yakePrerequisitesVC.h> +#elif (YAKE_PLATFORM == PLATFORM_WIN32) && (YAKE_COMPILER == COMPILER_GNUC) +# include <yake/base/prerequisites/yakePrerequisitesGCCWin.h> +#elif (YAKE_PLATFORM == PLATFORM_LINUX) && (YAKE_COMPILER == COMPILER_GNUC) +# include <yake/base/prerequisites/yakePrerequisitesGCC.h> +#else +# error("Yake: No configuration file set for the selected platform/compiler!") +#endif + +//============================================================================ +// INTERFACE STRUCTURES / UTILITY CLASSES +//============================================================================ +// Yake + +// YAKE_BASE_API +#if defined( YAKE_BASE_EXPORTS ) +# define YAKE_BASE_API DLLEXPORT +#else +# define YAKE_BASE_API DLLIMPORT +#endif + +// YAKE_DEBUG +#if defined(_DEBUG) || defined(DEBUG) +# define YAKE_DEBUG +#endif + +// YAKE_UNICODE: Not supported at the moment! +//#define YAKE_UNICODE + +#if defined(YAKE_UNICODE) +# define __T(X) L ## X +#else +# define __T(X) X +#endif + +// _T(X) Macro for defining strings ( +#define _T(X) __T(X) + +// STL +#if defined(YAKE_DEBUG_BUILD) +//# define _STLP_DEBUG 1 +#endif +#define _STLP_USE_DYNAMIC_LIB + +// Boost / TTL +#if (YAKE_PLATFORM == PLATFORM_WIN32) && (YAKE_COMPILER == COMPILER_GNUC) + #define YAKE_SIGNALS_USE_BOOST +#else + #define YAKE_SIGNALS_USE_BOOST + //#define YAKE_SIGNALS_USE_TTL +#endif + +// YAKE_REAL_PRECISION +// Determines the type used for 'real'. +// YAKE_REAL_SINGLE_PRECISION = float +// YAKE_REAL_DOUBLE_PRECISION = double +//@todo move this into configuration header +#define YAKE_REAL_SINGLE_PRECISION 1 +#define YAKE_REAL_DOUBLE_PRECISION 2 +#define YAKE_REAL_PRECISION YAKE_REAL_SINGLE_PRECISION +#if YAKE_REAL_PRECISION == YAKE_REAL_SINGLE_PRECISION + typedef float real; +#elif YAKE_REAL_PRECISION == YAKE_REAL_DOUBLE_PRECISION + typedef double real; +#else +# pragma error("yake: Unknown type for 'real'!") +#endif + + +// Helper macros +// todo: remove, deprecated, use safe_delete(_array) +#define YAKE_SAFE_RELEASE(ptr) if(ptr) { ptr->release(); ptr = 0; } +#define YAKE_SAFE_DELETE(ptr) if(ptr) { delete ptr; ptr = 0; } +#define YAKE_SAFE_DELETE_ARRAY(ptr_array) if(ptr_array) { delete [] ptr_array; ptr_array = 0; } + +#define YAKE_DECLARE_CLASS(name) static const char * yake_private_currentClass() { return #name; } +#define YAKE_DECLARE_GLOBAL YAKE_DECLARE_CLASS( global ) +#define YAKE_DECLARE_FUNCTION(name) static const char * yake_private_currentFunction = #name "()"; + +#define YAKE_FOR_EACH(ITER_TYPE,ITER_NAME,CTR) \ + for (ITER_TYPE ITER_NAME = CTR.begin(); ITER_NAME != CTR.end(); ++ITER_NAME) + + +#ifdef YAKE_DEBUG +# define YAKE_DYNLIB_POSTFIX "_d" +#else +# define YAKE_DYNLIB_POSTFIX +#endif +#define YAKE_DYNLIB_NAME(X) \ + yake::String("yake_" X YAKE_DYNLIB_POSTFIX).c_str() + +#endif // YAKE_BASE_PREREQUISITES_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |