eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // CoreOS.h Core.Component package 00003 //============================================================================ 00004 // Usage : Here is the place where OS dependencies are centralised 00005 //---------------------------------------------------------------------------- 00006 // Copyright (C) 2006 by eLynx project 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 // See the GNU Library General Public License for more details. 00017 //---------------------------------------------------------------------------- 00018 #ifndef __CoreOS_h__ 00019 #define __CoreOS_h__ 00020 00021 // ------------------ 00022 // eLynx SDK v3.3.0 00023 // ------------------ 00024 #define elxSDK_VERSION 3 00025 #define elxSDK_SUB_VERSION1 3 00026 #define elxSDK_SUB_VERSION2 0 00027 00028 // --- start OS section --- 00029 #if defined(WINDOWS) || defined(_WIN32) || defined(WIN32) 00030 00031 # define elxWINDOWS 1 00032 # define elxPLATFORM "Windows" 00033 # define elxMULTICORE 00034 #ifdef _DEBUG 00035 #define elxDEBUG 00036 #endif 00037 00038 #elif defined(linux) || defined(LINUX) 00039 00040 # define elxLINUX 1 00041 # define elxPLATFORM "Linux" 00042 00043 #elif defined(__APPLE__) && defined(__MACH__) 00044 00045 # define elxMACOSX 1 00046 # define elxPLATFORM "MacOSX" 00047 00048 #endif 00049 00050 // --- multicore section --- 00051 #if defined (elxMULTICORE) || defined (MULTICORE) || defined (multicore) 00052 #define elxUSE_THREAD 1 00053 #endif 00054 00055 // setup configuration string 00056 #ifdef elxDEBUG 00057 # define elxCONFIG "Debug" 00058 #else 00059 # define elxCONFIG "Release" 00060 #endif 00061 00062 //############################################################################ 00063 // WIN32 00064 //############################################################################ 00065 #ifdef elxWINDOWS 00066 00067 typedef unsigned char uint8; 00068 typedef signed char int8; 00069 typedef unsigned short uint16; 00070 typedef signed short int16; 00071 typedef unsigned int uint32; 00072 typedef signed int int32; 00073 typedef unsigned __int64 uint64; 00074 typedef signed __int64 int64; 00075 00076 #if (_MSC_VER < 1500) 00077 #pragma error "Compiler version not supported, please use at least Visual Studio 2008." 00078 #elif (_MSC_VER >= 1500) && (_MSC_VER < 1600) 00079 # define elxVC9 00080 # define elxVC 9 00081 # define elxVCS "9" 00082 #elif (_MSC_VER >= 1600) 00083 # define elxVC 10 00084 # define elxVC10 00085 # define elxVCS "10" 00086 #endif 00087 00088 #define elxLITTLE_ENDIAN 00089 00090 // exclude rarely-used stuff from Windows headers 00091 #define WIN32_LEAN_AND_MEAN 00092 00093 #ifdef SHOW_PLATFORM 00094 #pragma message ("#Selected platform is elxWINDOWS") 00095 #endif 00096 #pragma comment (compiler) 00097 #pragma comment (user, "File "__FILE__" compiled on " __DATE__ " at " __TIME__) 00098 00099 #include <windows.h> 00100 #include <stdlib.h> 00101 00102 // Turn on uint32 typedef 00103 typedef long elxTimeType; 00104 00105 // missing in <stdlib.h> from windows 00106 #ifdef ELYNX_CORE_EXPORTS 00107 // declaration in dll library 00108 __declspec(dllexport) float strtof(const char * p, char ** pend); 00109 __declspec(dllexport) int64 strtoll(const char * p, char ** pend, int base); 00110 __declspec(dllexport) int strcasecmp(const char *s1, const char *s2); 00111 __declspec(dllexport) int strncasecmp(const char *s1, const char *s2, size_t n); 00112 #else 00113 // client of the dll library 00114 __declspec(dllimport) float strtof(const char * p, char ** pend); 00115 __declspec(dllimport) int64 strtoll(const char * p, char ** pend, int base); 00116 __declspec(dllimport) int strcasecmp(const char *s1, const char *s2); 00117 __declspec(dllimport) int strncasecmp(const char *s1, const char *s2, size_t n); 00118 #endif 00119 00120 namespace eLynx { 00122 typedef HWND WinId; 00123 } 00124 00125 // define aliases for snprintf and vsnprintf functions 00126 #define elxSNPrintf _snprintf 00127 #define elxVSNPrintf _vsnprintf 00128 #define elxStrCaseCmp lstrcmpiA 00129 00130 #endif // elxWINDOWS 00131 00132 00133 //############################################################################ 00134 // LINUX 00135 //############################################################################ 00136 #ifdef elxLINUX 00137 00138 #define elxLITTLE_ENDIAN 00139 00140 #include <bits/types.h> 00141 #include <sys/types.h> 00142 #include <sys/time.h> 00143 00144 typedef unsigned char uint8; 00145 typedef signed char int8; 00146 typedef unsigned short uint16; 00147 typedef signed short int16; 00148 typedef unsigned int uint32; 00149 typedef signed int int32; 00150 typedef __uint64_t uint64; 00151 typedef __int64_t int64; 00152 00153 typedef timeval elxTimeType; 00154 00155 namespace eLynx { 00157 //typedef Window WinId; 00158 } 00159 00160 // define aliases for snprintf and vsnprintf functions 00161 #define elxSNPrintf snprintf 00162 #define elxVSNPrintf vsnprintf 00163 #define elxStrCaseCmp strcasecmp 00164 00165 #endif // elxLINUX 00166 00167 00168 //############################################################################ 00169 // MACOSX 00170 //############################################################################ 00171 #ifdef elxMACOSX 00172 00173 #define elxBIG_ENDIAN 00174 00175 namespace eLynx { 00177 typedef HWND WinId; 00178 } 00179 00180 //typedef timeval elxTimeType; 00181 00182 // define aliases for snprintf and vsnprintf functions 00183 #define elxSNPrintf snprintf 00184 #define elxVSNPrintf vsnprintf 00185 00186 #endif // elxMACOSX 00187 00188 00189 //############################################################################ 00190 00191 // --- end OS section --- 00192 00194 #define elxFIXME { char * p=0; *p=0; } 00195 00196 00197 00198 //############################################################################ 00199 // Pragma 00200 //############################################################################ 00201 #ifdef elxWINDOWS 00202 00203 // Disable level 3 warning 00204 #pragma warning( disable : 4251) 00205 #pragma warning( disable : 4661) 00206 00207 #endif //elxWINDOWS 00208 00209 #endif // __CoreOS_h__