home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Multimedia / xcd / core / portab.h next >
C/C++ Source or Header  |  2002-07-16  |  2KB  |  72 lines

  1. #ifndef _PORTAB_H_
  2. #define _PORTAB_H_
  3.  
  4. #if defined(WIN32)
  5.  
  6. #include <windows.h>
  7.  
  8. #define DEBUG_PRINT(S) OutputDebugString((S));
  9. #define DEBUG1_PRINT(S,I) { char tmp[100]; wsprintf(tmp, "%s %i\n", (S), (I)); OutputDebugString(tmp); }
  10. #define DEBUG2_PRINT(X,A,B) { char tmp[100]; wsprintf(tmp, "%s %i %i\n", (X), (A), (B)); OutputDebugString(tmp); }
  11. #define DEBUG3_PRINT(X,A,B,C){ char tmp[1000]; wsprintf(tmp,"%s %i %i %i",(X),(A), (B), (C)); OutputDebugString(tmp); }
  12. #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); }
  13.  
  14.  
  15.  
  16. #define int8_t char
  17. #define uint8_t unsigned char
  18. #define int16_t short
  19. #define uint16_t unsigned short
  20. #define int32_t int
  21. #define uint32_t unsigned int
  22. #define int64_t __int64
  23. #define uint64_t unsigned __int64
  24.  
  25. #define EMMS() __asm {emms}
  26.  
  27. #elif defined(LINUX) || defined(DJGPP)
  28.  
  29. #include <stdio.h>
  30. #define DEBUG_WHERE        stdout
  31. #define DEBUG_PRINT(S)        fprintf(DEBUG_WHERE, "%s\n", (S));
  32. #define DEBUG1_PRINT(S,I)     fprintf(DEBUG_WHERE, "%s %i\n", (S), (I))
  33. #define DEBUG2_PRINT(S,A,B)   fprintf(DEBUG_WHERE, "%s%i=%i\n", (S), (A), (B))
  34. #define DEBUG3_PRINT(S,A,B,C) fprintf(DEBUG_WHERE, "%s %i %x %x\n", (S), (A), (B), (C))
  35. #define DEBUG8_PRINT(S,A,B,C,D,E,F,G,H)
  36.  
  37. #if defined(LINUX)
  38.  
  39. #include <stdint.h>
  40.  
  41. #else
  42.  
  43. #define int8_t char
  44. #define uint8_t unsigned char
  45. #define int16_t short
  46. #define uint16_t unsigned short
  47. #define int32_t int
  48. #define uint32_t unsigned int
  49. #define int64_t long long
  50. #define uint64_t unsigned long long
  51.  
  52. #endif
  53.  
  54. #define EMMS() __asm__("emms\n\t")
  55.  
  56. #else // OTHER OS
  57.  
  58. #define DEBUG_PRINT(S)
  59. #define DEBUG1_PRINT(S,I)
  60. #define DEBUG2_PRINT(X,A,B)
  61. #define DEBUG3_PRINT(X,A,B,C)
  62. #define DEBUG8_PRINT(X,A,B,C,D,E,F,G,H)
  63.  
  64. #include <inttypes.h>
  65.  
  66. #define EMMS()
  67.  
  68. #endif
  69.  
  70. #endif // _PORTAB_H_
  71.  
  72.