Image Component Library (ICL)
|
00001 /******************************************************************** 00002 ** Image Component Library (ICL) ** 00003 ** ** 00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld ** 00005 ** Neuroinformatics Group ** 00006 ** Website: www.iclcv.org and ** 00007 ** http://opensource.cit-ec.de/projects/icl ** 00008 ** ** 00009 ** File : ICLUtils/src/ICLUtils/CompatMacros.h ** 00010 ** Module : ICLUtils ** 00011 ** Authors: Christof Elbrechter, Sergius Gaulik ** 00012 ** ** 00013 ** ** 00014 ** GNU LESSER GENERAL PUBLIC LICENSE ** 00015 ** This file may be used under the terms of the GNU Lesser General ** 00016 ** Public License version 3.0 as published by the ** 00017 ** ** 00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL ** 00019 ** included in the packaging of this file. Please review the ** 00020 ** following information to ensure the license requirements will ** 00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt ** 00022 ** ** 00023 ** The development of this software was supported by the ** 00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** 00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** 00026 ** Forschungsgemeinschaft (DFG) in the context of the German ** 00027 ** Excellence Initiative. ** 00028 ** ** 00029 ********************************************************************/ 00030 00031 #pragma once 00032 00033 #include <ICLUtils/ICLConfig.h> 00034 00035 #ifdef WIN32 00036 #define ICL_SYSTEMCALL_RM "del " 00037 #else 00038 #define ICL_SYSTEMCALL_RM "rm -rf " 00039 #endif 00040 00041 #ifdef WIN32 00042 #define NOMINMAX 00043 #define _USE_MATH_DEFINES 00044 #define M_PI 3.14159265358979323846 00045 // TODOWW: test with _MSC_VER == 1700 00046 #if (defined _MSC_VER && _MSC_VER < 1800) 00047 #include <cmath> 00048 inline double round(double a) 00049 { 00050 return floor(a + 0.5f); 00051 } 00052 inline double log2(double a) 00053 { 00054 return log(a) / 0.69314718055994530943; 00055 } 00056 inline float pow(int a, int b) 00057 { 00058 return pow((float)a, b); 00059 } 00060 inline double pow(float a, double b) 00061 { 00062 return pow((double)a, b); 00063 } 00064 inline int rint(double a) 00065 { 00066 // this is not really what it should do 00067 return (int)round(a); 00068 } 00069 inline float log(int a) 00070 { 00071 return log((float)a); 00072 } 00073 inline float exp(int a) 00074 { 00075 return exp((float)a); 00076 } 00077 inline float sqrt(int a) 00078 { 00079 return sqrt((float)a); 00080 } 00081 #endif 00082 // in windows use this instead of #warning 00083 #define WARNING(msg) message(__FILE__ "(" STRINGSIZE(__LINE__) ") : warning: " #msg) 00084 #endif 00085 00086 00087 #ifdef ICL_SYSTEM_WINDOWS 00088 # define IPP_DECL __stdcall 00089 #else 00090 # define IPP_DECL 00091 #endif 00092 00093 00095 00096 #ifdef WIN32 00097 00098 #ifdef ICLUtils_EXPORTS 00099 #define ICLUtils_API __declspec(dllexport) 00100 #else 00101 #define ICLUtils_API __declspec(dllimport) 00102 #endif 00103 00104 #ifdef ICLMath_EXPORTS 00105 #define ICLMath_IMP 00106 #define ICLMath_API __declspec(dllexport) 00107 #else 00108 #define ICLMath_IMP __declspec(dllimport) 00109 #define ICLMath_API __declspec(dllimport) 00110 #endif 00111 00112 #ifdef ICLCore_EXPORTS 00113 #define ICLCore_API __declspec(dllexport) 00114 #else 00115 #define ICLCore_API __declspec(dllimport) 00116 #endif 00117 00118 #ifdef ICLFilter_EXPORTS 00119 #define ICLFilter_API __declspec(dllexport) 00120 #else 00121 #define ICLFilter_API __declspec(dllimport) 00122 #endif 00123 00124 #ifdef ICLIO_EXPORTS 00125 #define ICLIO_API __declspec(dllexport) 00126 #else 00127 #define ICLIO_API __declspec(dllimport) 00128 #endif 00129 00130 #ifdef ICLIO_EXPORTS 00131 #define ICLIO_API __declspec(dllexport) 00132 #else 00133 #define ICLIO_API __declspec(dllimport) 00134 #endif 00135 00136 #ifdef ICLCV_EXPORTS 00137 #define ICLCV_API __declspec(dllexport) 00138 #else 00139 #define ICLCV_API __declspec(dllimport) 00140 #endif 00141 00142 #ifdef ICLQt_EXPORTS 00143 #define ICLQt_API __declspec(dllexport) 00144 #else 00145 #define ICLQt_API __declspec(dllimport) 00146 #endif 00147 00148 #ifdef ICLGeom_EXPORTS 00149 #define ICLGeom_API __declspec(dllexport) 00150 #else 00151 #define ICLGeom_API __declspec(dllimport) 00152 #endif 00153 00154 #ifdef ICLMarkers_EXPORTS 00155 #define ICLMarkers_API __declspec(dllexport) 00156 #else 00157 #define ICLMarkers_API __declspec(dllimport) 00158 #endif 00159 00160 #else 00161 #define ICLUtils_API 00162 #define ICLMath_IMP 00163 #define ICLMath_API 00164 #define ICLCore_API 00165 #define ICLFilter_API 00166 #define ICLIO_API 00167 #define ICLCV_API 00168 #define ICLQt_API 00169 #define ICLGeom_API 00170 #define ICLMarkers_API 00171 #endif 00172 00173 #ifdef ICL_HAVE_OPENGL 00174 #ifdef ICL_SYSTEM_APPLE 00175 #include <OpenGL/glew.h> 00176 #include <OpenGL/gl.h> 00177 #include <OpenGL/glu.h> 00178 #elif ICL_SYSTEM_WINDOWS 00179 #include <Windows.h> 00180 #include <GL/glew.h> 00181 #include <GL/gl.h> 00182 #include <GL/glu.h> 00183 #else 00184 #include <GL/glew.h> 00185 #include <GL/gl.h> 00186 #include <GL/glu.h> 00187 #endif 00188 #endif