StdAfx.h

Go to the documentation of this file.
00001 /* ES40 emulator.
00002  * Copyright (C) 2007-2008 by Camiel Vanderhoeven
00003  *
00004  * Website: www.camicom.com
00005  * E-mail : camiel@camicom.com
00006  * 
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  * 
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00020  * 
00021  * Although this is not required, the author would appreciate being notified of, 
00022  * and receiving any modifications you may make to the source code that might serve
00023  * the general public.
00024  */
00025 
00143 #if !defined(INCLUDED_STDAFX_H)
00144 #define INCLUDED_STDAFX_H
00145 
00146 // Include generated file with debugging flags (defines)
00147 #include "config_debug.h"
00148 
00149 #if defined(HAVE_CONFIG_H)
00150 #include "config.h"
00151 #elif defined(_WIN32)
00152 #include "config_win32.h"
00153 #elif defined(__VMS)
00154 #include "config_vms.h"
00155 #else
00156 #error "Need a config.h"
00157 #endif
00158 
00159 #include "datatypes.h"
00160 
00161 #if defined(HAVE_WINDOWS_H)
00162 #include <windows.h>
00163 #endif
00164 
00165 #if !defined(HAVE_STRCASECMP)
00166 #if defined(HAVE__STRICMP)
00167 #define strcasecmp(a, b)  _stricmp(a, b)
00168 #else
00169 #error "Need strcasecmp"
00170 #endif
00171 #endif // !defined(HAVE_STRCASECMP)
00172 
00173 #if !defined(HAVE_STRNCASECMP)
00174 #if defined(HAVE__STRNICMP)
00175 #define strncasecmp(a, b, c)  _strnicmp(a, b, c)
00176 #else
00177 #error "Need strncasecmp"
00178 #endif
00179 #endif // !defined(HAVE_STRNCASECMP)
00180 
00181 #if defined(HAVE_PROCESS_H)
00182 #include <process.h>
00183 #endif
00184 
00185 #if !defined(HAVE__STRDUP)
00186 #if defined(HAVE_STRDUP)
00187 #define _strdup(a)  strdup(a)
00188 #else
00189 #error "Need strdup"
00190 #endif
00191 #endif // !defined(HAVE__STRDUP)
00192 
00193 #if defined (HAVE_SYS_TIME_H)
00194 #include <sys/time.h>
00195 #endif
00196 
00197 #if defined (HAVE_UNISTD_H)
00198 #include <unistd.h>
00199 #endif
00200 
00201 #if defined (HAVE_PTHREAD_H)
00202 #include <pthread.h>
00203 #endif
00204 
00205 #if defined(HAVE_SIGNAL_H)
00206 #include <signal.h>
00207 #endif
00208 
00209 #if defined(HAVE_SYS_WAIT_H)
00210 #include <sys/wait.h>
00211 #endif
00212 
00213 #if defined(HAVE_STDLIB_H)
00214 #include <stdlib.h>
00215 #endif
00216 
00217 #if defined(HAVE_STDIO_H)
00218 #include <stdio.h>
00219 #endif
00220 
00221 #if defined(HAVE_STRING_H)
00222 #include <string.h>
00223 #endif
00224 
00225 #if defined(HAVE_MALLOC_H)
00226 #include <malloc.h>
00227 #endif
00228 
00229 #if defined(HAVE_TIME_H)
00230 #include <time.h>
00231 #endif
00232 
00233 #if defined(HAVE_CTYPE_H)
00234 #include <ctype.h>
00235 #endif
00236 
00237 #if !defined(HAVE_GMTIME_S)
00238 inline void gmtime_s(struct tm* t1, time_t* t2)
00239 {
00240   struct tm*  t3;
00241   t3 = gmtime(t2);
00242   memcpy(t1, t3, sizeof(struct tm));
00243 }
00244 #endif
00245 
00246 #if !defined(HAVE_ISBLANK)
00247 inline bool isblank(char c)
00248 {
00249   if(c == ' ' || c == '\t' || c == '\n' || c == '\r')
00250     return true;
00251   return false;
00252 }
00253 #endif
00254 
00255 inline char printable(char c)
00256 {
00257   if(isprint((unsigned char) c))
00258     return c;
00259   return '.';
00260 }
00261 
00262 // Different OS'es define different functions to access 64-bit files
00263 #if defined(HAVE_FOPEN64)
00264 #define fopen_large fopen64
00265 #elif defined(HAVE_FOPEN)
00266 #define fopen_large fopen
00267 #else
00268 #error "Need fopen"
00269 #endif
00270 
00271 #if defined(HAVE__FSEEKI64)
00272 #define fseek_large _fseeki64
00273 #elif defined(HAVE_FSEEKO64)
00274 #define fseek_large fseeko64
00275 #elif defined(HAVE_FSEEKO)
00276 #define fseek_large fseeko
00277 #elif defined(HAVE_FSEEK)
00278 #define fseek_large fseek
00279 #else
00280 #error "Need fseek"
00281 #endif
00282 
00283 #if defined(HAVE__FTELLI64)
00284 #define ftell_large _ftelli64
00285 #define off_t_large __int64
00286 #elif defined(HAVE_FTELLO64)
00287 #define ftell_large ftello64
00288 #define off_t_large off64_t
00289 #elif defined(HAVE_FTELLO)
00290 #define ftell_large ftello
00291 #define off_t_large off_t
00292 #elif defined(HAVE_FTELL)
00293 #define ftell_large ftell
00294 #define off_t_large off_t
00295 #else
00296 #error "Need ftell"
00297 #endif
00298 
00299 #include <typeinfo>
00300 
00301 #define POCO_NO_UNWINDOWS
00302 
00303 #if defined(__VMS)
00304 #include "VMS/Thread.h"
00305 #include "VMS/Runnable.h"
00306 #include "VMS/Semaphore.h"
00307 #include "VMS/Mutex.h"
00308 #include "VMS/Timestamp.h"
00309 #include "VMS/RWLock.h"
00310 #else
00311 #include <Poco/Thread.h>
00312 #include <Poco/Runnable.h>
00313 #include <Poco/Semaphore.h>
00314 #include <Poco/Mutex.h>
00315 #include <Poco/Timestamp.h>
00316 #include <Poco/RWLock.h>
00317 #endif
00318 
00319 #include "es40_debug.h"
00320 
00321 #include "Exception.h"
00322 #include "Lock.h"
00323 
00324 #include "es40_endian.h"
00325 #endif // !defined(INCLUDED_STDAFX_H)

SourceForge.net Logo
Project space on SourceForge.net