home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 April
/
CMCD0404.ISO
/
Software
/
Freeware
/
Multimedia
/
xcd
/
core
/
portab.h
next >
Wrap
C/C++ Source or Header
|
2002-07-16
|
2KB
|
72 lines
#ifndef _PORTAB_H_
#define _PORTAB_H_
#if defined(WIN32)
#include <windows.h>
#define DEBUG_PRINT(S) OutputDebugString((S));
#define DEBUG1_PRINT(S,I) { char tmp[100]; wsprintf(tmp, "%s %i\n", (S), (I)); OutputDebugString(tmp); }
#define DEBUG2_PRINT(X,A,B) { char tmp[100]; wsprintf(tmp, "%s %i %i\n", (X), (A), (B)); OutputDebugString(tmp); }
#define DEBUG3_PRINT(X,A,B,C){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i",(X),(A), (B), (C)); OutputDebugString(tmp); }
#define DEBUG8_PRINT(X,A,B,C,D,E,F,G,H){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i %i %i %i %i %i",(X),(A),(B),(C),(D),(E),(F),(G),(H)); OutputDebugString(tmp); }
#define int8_t char
#define uint8_t unsigned char
#define int16_t short
#define uint16_t unsigned short
#define int32_t int
#define uint32_t unsigned int
#define int64_t __int64
#define uint64_t unsigned __int64
#define EMMS() __asm {emms}
#elif defined(LINUX) || defined(DJGPP)
#include <stdio.h>
#define DEBUG_WHERE stdout
#define DEBUG_PRINT(S) fprintf(DEBUG_WHERE, "%s\n", (S));
#define DEBUG1_PRINT(S,I) fprintf(DEBUG_WHERE, "%s %i\n", (S), (I))
#define DEBUG2_PRINT(S,A,B) fprintf(DEBUG_WHERE, "%s%i=%i\n", (S), (A), (B))
#define DEBUG3_PRINT(S,A,B,C) fprintf(DEBUG_WHERE, "%s %i %x %x\n", (S), (A), (B), (C))
#define DEBUG8_PRINT(S,A,B,C,D,E,F,G,H)
#if defined(LINUX)
#include <stdint.h>
#else
#define int8_t char
#define uint8_t unsigned char
#define int16_t short
#define uint16_t unsigned short
#define int32_t int
#define uint32_t unsigned int
#define int64_t long long
#define uint64_t unsigned long long
#endif
#define EMMS() __asm__("emms\n\t")
#else // OTHER OS
#define DEBUG_PRINT(S)
#define DEBUG1_PRINT(S,I)
#define DEBUG2_PRINT(X,A,B)
#define DEBUG3_PRINT(X,A,B,C)
#define DEBUG8_PRINT(X,A,B,C,D,E,F,G,H)
#include <inttypes.h>
#define EMMS()
#endif
#endif // _PORTAB_H_