home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / fd2pragma / source / include / sdi_defines.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-09  |  3.0 KB  |  101 lines

  1. #ifndef SDI_DEFINES_H
  2. #define SDI_DEFINES_H
  3.  
  4. /* Includeheader
  5.  
  6.     Name:        SDI_defines
  7.     Versionstring:    $VER: SDI_defines.h 1.32 (30.04.2000)
  8.     Author:        SDI
  9.     Distribution:    PD
  10.     Description:    standard defines and macros and version string
  11.  
  12.  1.17  12.06.96 : RETURN_WARN instead of RETURN_ERROR in SDI_ENDCODE
  13.  1.18  06.07.96 : End: PrintFault behind end --> allows selecting output
  14.  1.19  21.08.96 : added __SASC __AMIGADATE__ support
  15.  1.20  24.08.96 : better SAS-C support
  16.  1.21  04.09.96 : changed error with SAS date having the brackets already
  17.  1.22  18.11.96 : converted to english, C++ comments to C ones
  18.  1.23  02.01.97 : corrected some stuff
  19.  1.24  17.03.97 : removed GetChar and other obsolete defines
  20.  1.25  08.10.97 : renamed defines, removed some defines
  21.  1.26  10.02.98 : made version string const
  22.  1.27  20.02.98 : added compiler independence stuff
  23.  1.28  25.06.98 : compiler independent stuff moved to SDI_compiler.h
  24.  1.29  01.09.98 : fixes for StormC Demo
  25.  1.30  06.05.99 : changed AUTHOR string
  26.  1.31  17.11.99 : date stuff now defaults to __DATE__ for unknown compiler
  27.  1.32  30.04.00 : excluded SDI_version.h
  28. */
  29.  
  30. #include <exec/types.h>
  31.  
  32. /* ========================= useable defines ============================ */
  33.  
  34. /*
  35.   SDI_ENDCODE        turn on generation of End function
  36.   SDI_ENDCODE_NOCTRLC    use End generation without CTRL_C check
  37.  
  38.   AUTHOR    program author - default is "by SDI"
  39.   DATE        programm creation date - default is automatically created
  40.   DISTRIBUTION    distribution form - default is "(PD) "
  41.   REVISION    revision number - default is "0"
  42.   VERSION    version number - default is "1"
  43. */
  44.  
  45. /* ======================= no need for <stdlib.h> ======================= */
  46.  
  47. #ifdef __cplusplus
  48.   extern "C"
  49. #endif
  50. extern void exit(int);
  51.  
  52. /* ============================ other macros ============================ */
  53.  
  54. /* <proto/exec.h>, <dos/dos.h> */
  55.  
  56. #define CTRL_C        (SetSignal(0L,0L) & SIGBREAKF_CTRL_C)
  57.  
  58. /* ================================= SAS C ============================== */
  59.  
  60. #define TestOS if(DOSBase->dl_lib.lib_Version < DosVersion)    \
  61.              exit(RETURN_FAIL)
  62.  
  63. /* A word about variable DosVersion: In my startup code for MaxonC++ I
  64. include use OpenLibrary("dos.library", DosVersion) instead of standard
  65. OpenLibrary("dos.library",0) call. If no DosVersion is given, this
  66. variable defaults to 33, else you can give the value by creating a global
  67. variable ULONG DosVersion = 37;. The program does not start, when the
  68. required DOS is not available. (Better then others, which crash) */
  69.  
  70. /* ===================== version string and EndCode ===================== */
  71.  
  72.  
  73. #ifdef NAME
  74.   #include "SDI_version.h"
  75. #endif /* NAME */
  76.  
  77. #if defined(SDI_ENDCODE) || defined(SDI_ENDCODE_NOCTRLC)
  78.   #include "SDI_compiler.h"
  79.  
  80.   INLINE void end(void);
  81.  
  82.   void End(UBYTE err)
  83.   {
  84.     #ifndef SDI_ENDCODE_NOCTRLC
  85.     if(CTRL_C)
  86.     {
  87.       err = RETURN_WARN;
  88.       SetIoErr(ERROR_BREAK);
  89.     }
  90.     #endif
  91.  
  92.     end();
  93.  
  94.     if(err)        PrintFault(IoErr(), 0);
  95.     exit(err);
  96.   }
  97. #endif /* SDI_ENDCODE && SDI_ENDCODE_NOCTRLC */
  98.  
  99. #endif /* SDI_DEFINES_H */
  100.  
  101.