home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser 2002 January / STC_CD_01_2002.iso / APP / TRAIL_PG / GEMJING / GEMJ136.LZH / Develop / INCLUDE / PORTABN.H
C/C++ Source or Header  |  1996-03-07  |  9KB  |  214 lines

  1. #ifndef __PORTAB__
  2. #define __PORTAB__
  3.  
  4. #define GEMDOS     1                          /* Digital Research GEMDOS     */
  5. #define MSDOS      0                          /* Microsoft MSDOS             */
  6. #define OS2        0                          /* Microsoft OS/2              */
  7. #define FLEXOS     0                          /* Digital Research FlexOS     */
  8. #define UNIX       0                          /* Unix Operating System       */
  9.  
  10. #define M68000     1                          /* Motorola Processing Unit    */
  11. #define I8086      0                          /* Intel Processing Unit       */
  12.  
  13. #define DR_C       0                          /* Digital Research C Compiler */
  14. #define LASER_C    0                          /* Laser C Compiler            */
  15. #define LATTICE_C  0                          /* Lattice C Compiler          */
  16. #define MW_C       0                          /* Mark Williams C Compiler    */
  17. #define TURBO_C    1                          /* Turbo C Compiler            */
  18. #define MS_C       0                          /* Microsoft C Compiler        */
  19. #define HIGH_C     0                          /* Metaware High C Compiler    */
  20. #define PCC        0                          /* Portable C-Compiler         */
  21.  
  22. #define GEM1       0x0001                     /* ATARI GEM version           */
  23. #define GEM2       0x0002                     /* MSDOS GEM 2.x versions      */
  24. #define GEM3       0x0004                     /* MSDOS GEM/3 version         */
  25. #define XGEM       0x0100                     /* OS/2,FlexOS X/GEM version   */
  26.  
  27. #ifndef GEM
  28. #if GEMDOS
  29. #define GEM        GEM1                       /* GEMDOS default is GEM1      */
  30. #endif /* GEMDOS */
  31. #endif
  32.  
  33. /*****************************************************************************/
  34. /* STANDARD TYPE DEFINITIONS                                                 */
  35. /*****************************************************************************/
  36.  
  37. #define BYTE    signed char                   /* Signed byte                 */
  38. #define UBYTE   unsigned char                 /* Unsigned byte               */
  39.  
  40. #if LATTICE_C | PCC
  41. #define WORD    short                         /* Signed word (16 bits)       */
  42. #define UWORD   unsigned short                /* Unsigned word               */
  43. #else
  44. #define WORD    int                           /* Signed word (16 bits)       */
  45. #define UWORD   unsigned int                  /* Unsigned word               */
  46. #endif
  47.  
  48. #define LONG    long                          /* Signed long (32 bits)       */
  49. #define ULONG   unsigned long                 /* Unsigned long               */
  50.  
  51. #define BOOLEAN WORD                          /* 2 valued (true/false)       */
  52.  
  53. #define FLOAT   float                         /* Single precision float      */
  54. #define DOUBLE  double                        /* Double precision float      */
  55.  
  56. #define INT     int                           /* A machine dependent int     */
  57. #define UINT    unsigned int                  /* A machine dependent uint    */
  58.  
  59. #define REG     register                      /* Register variable           */
  60. #define AUTO    auto                          /* Local to function           */
  61. #define EXTERN  extern                        /* External variable           */
  62. #define LOCAL   static                        /* Local to module             */
  63. #define MLOCAL  LOCAL                         /* Local to module             */
  64. #define GLOBAL                                /* Global variable             */
  65.  
  66. /*****************************************************************************/
  67. /* COMPILER DEPENDENT DEFINITIONS                                            */
  68. /*****************************************************************************/
  69.  
  70. #if GEMDOS                                    /* GEMDOS compilers            */
  71. #if DR_C
  72. #define void WORD                             /* DR_C doesn't know void      */
  73. #endif /* DR_C */
  74.  
  75. #if LASER_C
  76. #define vqt_font_info vqt_fontinfo            /* Wrong GEM binding           */
  77. #define graf_mbox graf_movebox                /* Wrong GEM binding           */
  78. #define graf_rubbox graf_rubberbox            /* Wrong GEM binding           */
  79. #endif /* LASER_C */
  80.  
  81. #if LATTICE_C
  82. #define vqt_font_info vqt_fontinfo            /* Wrong GEM binding           */
  83. #define graf_mbox graf_movebox                /* Wrong GEM binding           */
  84. #define graf_rubbox graf_rubberbox            /* Wrong GEM binding           */
  85. #endif /* LATTICE_C */
  86.  
  87. #if TURBO_C
  88. #define graf_mbox graf_movebox                /* Wrong GEM binding           */
  89. #define graf_rubbox graf_rubberbox            /* Wrong GEM binding           */
  90. #endif /* TURBO_C */
  91.  
  92. #if MW_C
  93. #define VOID WORD                             /* MW_C doesn't know (void *)  */
  94. #endif /* MW_C */
  95.  
  96. #if LATTICE_C
  97. #define ADR(A) (LONG)A >> 16, (LONG)A & 0xFFFF
  98. #else
  99. #define ADR(A) (WORD)((LONG)A >> 16), (WORD)((LONG)A & 0xFFFF)
  100. #endif /* LATTICE_C */
  101. #endif /* GEMDOS */
  102.  
  103. #if MSDOS | OS2                               /* MSDOS or OS2 compilers      */
  104. #define ADR(A) (WORD)((LONG)A & 0xFFFF), (WORD)((LONG)A >> 16)
  105. #endif /* MSDOS */
  106.  
  107. #if FLEXOS                                    /* FlexOS compilers            */
  108. #define ADR(A) (WORD)((LONG)A & 0xFFFF), (WORD)((LONG)A >> 16)
  109. #endif /* FLEXOS */
  110.  
  111. #if MS_C | TURBO_C | HIGH_C                   /* ANSI compilers              */
  112. #define ANSI 1
  113. #define _(params) params                      /* Parameter checking          */
  114. #else
  115. #define ANSI 0
  116. #define _(params) ()                          /* No parameter checking       */
  117. #define const
  118. #define volatile
  119. #if DR_C | LASER_C | LATTICE_C | MW_C
  120. #define size_t UINT
  121. #endif
  122. #endif
  123.  
  124. #if DR_C | LASER_C | LATTICE_C | MW_C | HIGH_C | PCC
  125. #define cdecl
  126. #define pascal
  127. #endif
  128.  
  129. #define CONST    const
  130. #define VOLATILE volatile
  131. #define CDECL    cdecl
  132. #define PASCAL   pascal
  133.  
  134. #define SIZE_T   size_t
  135.  
  136. #ifndef VOID
  137. #define VOID     void
  138. #endif
  139.  
  140. /*****************************************************************************/
  141. /* OPERATING SYSTEM DEPENDENT DEFINITIONS                                    */
  142. /*****************************************************************************/
  143.  
  144. #if GEMDOS | UNIX
  145. #define NEAR                                  /* Near pointer                */
  146. #define FAR                                   /* Far pointer                 */
  147. #define HUGE                                  /* Huge pointer                */
  148. #else
  149. #if HIGH_C
  150. #define NEAR   _near                          /* Near pointer                */
  151. #define FAR    _far                           /* Far pointer                 */
  152. #define HUGE   _huge                          /* Huge pointer                */
  153. #else
  154. #define NEAR    near                          /* Near pointer                */
  155. #define FAR     far                           /* Far pointer                 */
  156. #define HUGE    huge                          /* Huge pointer                */
  157. #endif /* HIGH_C */
  158. #endif /* GEMDOS */
  159.  
  160. #if MSDOS | OS2 | FLEXOS                      /* MSDOS or OS2 compilers      */
  161. #define FPOFF(a)  (UWORD)(a)
  162. #define FPSEG(a)  ((UWORD)((ULONG)(a) >> 16))
  163. #define MKFP(a,b) ((VOID FAR *)(((ULONG)(a) << 16) | (UWORD)(b)))
  164. #endif /* MSDOS | OS2 | FLEXOS */
  165.  
  166. #if FLEXOS                                    /* FlexOS compilers            */
  167. #define main GEMAIN                           /* Because of X/GEM SRTL       */
  168. #endif /* FLEXOS */
  169.  
  170. #if GEM & (GEM1 | XGEM)
  171. #define shel_rdef(lpcmd, lpdir)
  172. #define shel_wdef(lpcmd, lpdir)
  173. #endif /* GEM1 | XGEM */
  174.  
  175. #if GEM & (GEM1 | GEM2)
  176. #define menu_click(click, setit)
  177. #define v_copies(handle, count)
  178. #define v_etext(handle, x, y, string, offsets)
  179. #define v_orient(handle, orientation)
  180. #define v_tray(handle, tray)
  181. /*#define v_xbit_image(handle, filename, aspect, x_scale, y_scale, h_align,
  182. v_align, rotate, background, foreground, xy)\
  183.         v_bit_image (handle, filename, aspect, x_scale, y_scale, h_align,
  184. v_align, xy)*/
  185. #define vst_ex_load_fonts(handle, select, font_max, font_free)\
  186.         vst_load_fonts   (handle, select)
  187. #endif /* GEM1 | GEM2 */
  188.  
  189. #if GEM & (GEM2 | GEM3 | XGEM)
  190. #define fsel_exinput(pipath, pisel, pbutton, plabel)\
  191.         fsel_input  (pipath, pisel, pbutton)
  192. #define wind_new()
  193. #endif /* GEM2 | GEM3 | XGEM */
  194.  
  195. /*****************************************************************************/
  196. /* MISCELLANEOUS DEFINITIONS                                                 */
  197. /*****************************************************************************/
  198.  
  199. #ifndef FALSE
  200. #define FALSE   (BOOLEAN)0                    /* Function FALSE value        */
  201. #define TRUE    (BOOLEAN)1                    /* Function TRUE  value        */
  202. #endif
  203.  
  204. #define FAILURE (-1)                          /* Function failure return val */
  205. #define SUCCESS 0                             /* Function success return val */
  206. #define FOREVER for (;;)                      /* Infinite loop declaration   */
  207. #define EOS     '\0'                          /* End of string value         */
  208.  
  209. #ifndef EOF
  210. #define EOF     (-1)                          /* EOF value                   */
  211. #endif
  212.  
  213. #endif
  214.