home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / nasm20b / nasm_src / defines.h < prev    next >
C/C++ Source or Header  |  1993-01-18  |  7KB  |  269 lines

  1. /* ---------------------------------------------------------------------- */
  2. /*                   Copyright (C) 1991 by Natuerlich!                    */
  3. /*                      This file is copyrighted!                         */
  4. /*                Refer to the documentation for details.                 */
  5. /* ---------------------------------------------------------------------- */
  6. #ifndef __DEFINES__
  7. # define __DEFINES__
  8.  
  9. # define UE__          'u', 'e'   /* or ue character */
  10. # define INCOMPATIBLE  0U
  11. # define VERSION       2U
  12.  
  13. # define DVERSION      (VERSION | (INCOMPATIBLE << 8))
  14. # define ASMREVISION   0   /* was 2.0 */
  15. # define LINKREVISION  0   /* was 2.0 */
  16. # define LIBREVISION   0   /* was 2.0 */
  17.  
  18.                                           /* object read compatibility */
  19. # if VERSION                                          
  20. # define OBJ_READ_COMP (1 | (INCOMPATIBLE << 8))  
  21. # define LIB_READ_COMP (1 | (INCOMPATIBLE << 8))  
  22. #else
  23. # define OBJ_READ_COMP 0
  24. # define LIB_READ_COMP 0
  25. #endif
  26.  
  27. # define AUTHOR        'N','a','t',UE__,'r','l','i','c','h','!'
  28. # define ORGANIZATION  'M','u','l','l','e',' ',                  \
  29.                        'S','o','f','t','w','a','r','e',' ',      \
  30.                        'D','e','s','i','g','n'      /* just for fun */
  31.  
  32.  
  33. /* ----------------------------------------------------------
  34.     This define file is supposed to be used for global hacks   
  35.     to the source code (like turning debugging on) and ad-     
  36.     justments to various operating systems or machineries.     
  37.                                                               
  38.     anyway some/most/all of this can be triggered my compiler  
  39.     command line defines as well.                              
  40.    ---------------------------------------------------------- */
  41. # include "natdefs.h"
  42.  
  43. #if __TCPLUSPLUS__ || __STDC__
  44. # define __NSTDC__  1
  45. #endif
  46.  
  47.  
  48. # if ! __NSTDC__
  49. #  define signed
  50. # endif
  51.  
  52. # if VERSION
  53. #  define lint             1
  54. # endif
  55.  
  56. # ifndef VERY_PRETTY
  57. #  define VERY_PRETTY      1
  58. # endif
  59.  
  60. # ifndef DEBUG                   /* for make friends */
  61. #  define DEBUG            0
  62. # endif
  63.  
  64. # ifndef EXPERIMENTAL            /* non-portable, useless code  */
  65. #  define EXPERIMENTAL     0
  66. # endif
  67.  
  68. # ifndef DORECLAIM               /* try to reclaim old expr ? */
  69. #  define DORECLAIM        1
  70. # endif
  71.  
  72. # if ! VERSION
  73. #  define register
  74. #  ifndef STATISTICS
  75. #   define STATISTICS      1     /* USE ONLY WITH version SET to 0 */
  76. #  endif
  77. # else
  78. #  ifdef STATISTICS
  79. #   error "No statistix with version > 0"
  80. #  endif
  81. # endif
  82.  
  83.  
  84. # include "localdef.h"
  85.  
  86. # if MACHINERY == MOTOROLA
  87. #  undef  BIGENDIAN
  88. #  define BIGENDIAN        0
  89. #  ifndef WORD_EVEN
  90. #   define WORD_EVEN       1
  91. #  endif
  92. # endif
  93.  
  94. # if MACHINERY == INTEL
  95. #  define SUCKER           INTEL
  96. #  undef  BIGENDIAN
  97. #  define BIGENDIAN        1
  98. #  ifndef WORD_EVEN
  99. #   define WORD_EVEN       0
  100. #  endif
  101. # endif
  102.  
  103. # if MACHINERY != SUCKER || ! defined( __HUGE__) /* well.... */
  104. #  define huge
  105. # endif
  106.  
  107.  
  108. # if OS == TOS                       /* Set some compiler pecularities */
  109. #  if __TURBOC__
  110. #   ifndef PHILOSOPHICAL_PROBLEM
  111. #    define PHILOSOPHICAL_PROBLEM  0
  112. #   endif
  113. #   ifndef LATEPLUSPLUS
  114. #    define LATEPLUSPLUS  0
  115. #   endif
  116. #   ifndef STSIZE
  117. #    define STSIZE        4
  118. #   endif
  119. #   ifndef CANCONCAT
  120. #    define CANCONCAT     1
  121. #   endif
  122. #  endif
  123. #  ifndef WITHNOISY
  124. #   define WITHNOISY      1         /* reminisce the good ol' times */
  125. #  endif
  126. # endif
  127.  
  128. # if OS == MSDOS
  129. #  if __TCPLUSPLUS__
  130. #   ifndef PHILOSOPHICAL_PROBLEM
  131. #    define PHILOSOPHICAL_PROBLEM  1
  132. #   endif
  133. #   ifndef LATEPLUSPLUS
  134. #    define LATEPLUSPLUS  1
  135. #   endif
  136. #   ifndef STSIZE
  137. #    define STSIZE        2
  138. #   endif
  139. #   ifndef CANCONCAT
  140. #    define CANCONCAT     1
  141. #   endif
  142. #  else
  143. #   if __TURBOC__
  144. #    ifndef PHILOSOPHICAL_PROBLEM
  145. #     define PHILOSOPHICAL_PROBLEM  0
  146. #    endif
  147. #    ifndef LATEPLUSPLUS
  148. #     define LATEPLUSPLUS  1
  149. #    endif
  150. #    ifndef STSIZE
  151. #     define STSIZE        2
  152. #    endif
  153. #    ifndef CANCONCAT
  154. #     define CANCONCAT     1
  155. #    endif
  156. #   endif
  157. #  endif
  158. # endif
  159.  
  160. # if OS == UNIX               /* this is for gcc */
  161. #  ifndef PHILOSOPHICAL_PROBLEM
  162. #   define PHILOSOPHICAL_PROBLEM  0
  163. #  endif
  164. #  ifndef LATEPLUSPLUS
  165. #   define LATEPLUSPLUS  1
  166. #  endif
  167. #  ifndef STSIZE
  168. #   define STSIZE        2
  169. #  endif
  170. #  ifndef CANCONCAT
  171. #   define CANCONCAT     1
  172. #  endif
  173. # endif
  174.  
  175. # if OS == AMIGA
  176. #  ifndef PHILOSOPHICAL_PROBLEM
  177. #   define PHILOSOPHICAL_PROBLEM  1
  178. #  endif
  179. #  ifndef LATEPLUSPLUS
  180. #   define LATEPLUSPLUS  1
  181. #  endif
  182. #  ifndef STSIZE
  183. #   define STSIZE        2
  184. #  endif
  185. #  ifndef CANCONCAT
  186. #   define CANCONCAT     2
  187. #  endif
  188. # endif
  189.  
  190. #define byte   unsigned _BYTE
  191. #define word   unsigned _WORD
  192. #define lword  unsigned _LONG
  193. #define sbyte  signed   _BYTE
  194. #define sword  signed   _WORD
  195. #define slword signed   _LONG
  196.  
  197. /* -------------------------------------------------------------- */
  198. /* Now trying to do this really portably come the definitions for */
  199. /* the various compilers, operating systems and machinery.        */
  200. /* File I/O on a binary level is unfortunately not very portable  */
  201. /* so you have to manually declare some flags for OPEN & CREAT    */
  202. /*                So far UNIX, MSDOS && TOS work.                 */
  203. /* -------------------------------------------------------------- */
  204. # if OS == TOS
  205. #  define OPEN_W       0
  206. #  define OPEN_R       1
  207. #  define OPEN_RW      2
  208. #  define CREAT_RW     0
  209.  
  210. #  define DIRSLASH     '\\'        /* for ye olde TOS machinery     */
  211. #  define Xtolower( x) (((x) >= 'A' && (x) <= 'Z') ? (x) + 32 : (x))
  212. #  define LOWERFILE    1
  213. #  if __TURBOC__
  214. #   define OSBIND      <tos.h>
  215. #  else
  216. #   define OSBIND      <osbind.h>
  217. #  endif
  218. #  define Fkreate( pathname, mode)  Fcreate( pathname, 0)
  219. # else                                 /* for the rest of the world */
  220. #  define OSBIND        "xosbind.h"    /* ..like this dog is portable.. */
  221. # endif
  222.  
  223. # ifndef BCOPYTHERE
  224. #  ifndef SUN
  225. #   include <string.h>
  226. #  endif
  227. #  define bcopy( a, b, c) memcpy( (void *) (b), (void *) (a), (c))
  228. #  define bzero( a, b)    memset( (void *) (a), 0, (b))
  229. # endif
  230.  
  231. # ifndef _TO_UPPER_
  232. extern byte            _uptable[];
  233. #  define _TO_UPPER_   1
  234. # endif
  235.  
  236. # define to_upper( c)      (_uptable[ (c)])
  237.  
  238. # if MSDOS && INTEL       /* This shit neccessary for INTEL */
  239. #  define add_offset(p, o) \
  240.         MK_FP(FP_SEG( p) + ((o) >> 4), FP_OFF( p) + ((o) & 0xF))
  241. #  define get_ADDR( p)  (((lword) FP_SEG( p) << 4) + FP_OFF( p))
  242. # else
  243. #  define add_offset( p, o) ((char *) (p) + (o))
  244. #  define get_ADDR( p)  ((lword) (p))
  245. # endif
  246.  
  247. # if (__TURBOC__ || __TCPLUSPLUS__) && VERY_PRETTY
  248. #  pragma warn -rvl     /* instead of very pretty                      */
  249. #  pragma warn -pia     /* Don't want those if( foo = bar) warnings    */
  250. #  pragma warn -pro     /* Also we don't care about prototypes anymore */
  251. #  pragma warn +sig     /* (used to, but that's all over now)          */
  252. #  pragma warn +use
  253. #  pragma warn +stv
  254. #  pragma warn +amb
  255. #  pragma warn +amp
  256. # endif
  257.  
  258. # define NMALLOC_H   "nmalloc.h"   /* predefine this */
  259. /* ---------------------------------------------------------- */
  260. /* If U do something to the source, here's your claim 2 fame  */
  261. /* ---------------------------------------------------------- */
  262. # define PORTED  OS != TOS && OS != MSDOS && OS != UNIX
  263. # if PORTED            /* **-Port #3-** */
  264. #  define PORTER  'y','o','u','r',' ','n','a','m','e'
  265. # endif
  266.  
  267. # define ESTREAM      stdout
  268. #endif
  269.