home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 52
/
Amiga_Dream_52.iso
/
Amiga
/
Workbench
/
Patches
/
CopyReplace.lha
/
Source
/
Include
/
SDI_defines.h
< prev
Wrap
C/C++ Source or Header
|
1998-05-08
|
4KB
|
146 lines
#ifndef SDI_DEFINES_H
#define SDI_DEFINES_H
/* Includeheader
Name: SDI_defines
Versionstring: $VER: SDI_defines.h 1.27 (20.02.1998)
Author: SDI
Distribution: PD
Description: standard defines and macros and version string
1.17 12.06.96 : RETURN_WARN instead of RETURN_ERROR in SDI_ENDCODE
1.18 06.07.96 : End: PrintFault behind end --> allows selecting output
1.19 21.08.96 : added __SASC __AMIGADATE__ support
1.20 24.08.96 : better SAS-C support
1.21 04.09.96 : changed error with SAS date having the brackets already
1.22 18.11.96 : converted to english, C++ comments to C ones
1.23 02.01.97 : corrected some stuff
1.24 17.03.97 : removed GetChar and other obsolete defines
1.25 08.10.97 : renamed defines, removed some defines
1.26 10.02.98 : made version string const
1.27 20.02.98 : added compiler independence stuff
*/
#include <exec/types.h>
/* ========================= useable defines ============================ */
/*
SDI_ENDCODE turn on generation of End function
SDI_ENDCODE_NOCTRLC use End generation without CTRL_C check
AUTHOR program author - default is "by SDI"
DATE programm creation date - default is automatically created
DISTRIBUTION distribution form - default is "(PD) "
REVISION revision number - default is "0"
VERSION version number - default is "1"
*/
/* ==================== compiler independence stuff ===================== */
#ifdef __MAXON__ /* disable these keywords */
#define __saveds
#define __stdargs
#define __regars
#elif defined(__STORM__)
#define __regargs
#define __stdargs
#endif
/* make new keywords for ASM funcs - exceptions */
#if defined(__SASC)
#define ASM(arg) arg __asm
#elif defined(__GNUC__)
#define REG(reg,arg) arg __asm(#reg)
#endif
/* then common ASM-use defines */
#ifndef ASM
#define ASM(arg) arg
#endif
#ifndef REG
#define REG(reg,arg) register __##reg arg
#endif
/* ======================= no need for <stdlib.h> ======================= */
extern void exit(int);
/* ============================ other macros ============================ */
/* <proto/exec.h>, <dos/dos.h> */
#define CTRL_C (SetSignal(0L,0L) & SIGBREAKF_CTRL_C)
/* ================================= SAS C ============================== */
#define TestOS if(DOSBase->dl_lib.lib_Version < DosVersion) \
exit(RETURN_FAIL)
/* A word about variable DosVersion: In my startup code for MaxonC++ I
include use OpenLibrary("dos.library", DosVersion) instead of standard
OpenLibrary("dos.library",0) call. If no DosVersion is given, this
variable defaults to 33, else you can give the value by creating a global
variable ULONG DosVersion = 37;. The program does not start, when the
required DOS is not available. (Better then others, which crash) */
/* ===================== version string and EndCode ===================== */
#ifdef NAME
#ifndef AUTHOR
#define AUTHOR "by SDI"
#endif
#ifndef VERSION
#define VERSION "1"
#endif
#ifndef REVISION
#define REVISION "0"
#endif
#ifndef DATE
#ifdef __MAXON__
#define SDI_DATE "(" __DATE2__ ")"
#elif defined(__SASC)
#define SDI_DATE __AMIGADATE__
#elif defined(__GNUC__)
#define SDI_DATE "(" __DATE__ ")"
#endif
#else
#define SDI_DATE "(" DATE ")"
#endif
#ifndef DISTRIBUTION
#define DISTRIBUTION "(PD) "
#endif
const STRPTR version = (STRPTR) "$VER: " NAME " " VERSION "." REVISION " "
SDI_DATE " " DISTRIBUTION AUTHOR;
#endif /* NAME */
#if defined(SDI_ENDCODE) || defined(SDI_ENDCODE_NOCTRLC)
#ifdef __MAXON__
#define __inline
inline
#endif
void __inline end(void);
void End(UBYTE err)
{
#ifndef SDI_ENDCODE_NOCTRLC
if(CTRL_C)
{
err = RETURN_WARN;
SetIoErr(ERROR_BREAK);
}
#endif
end();
if(err) PrintFault(IoErr(), 0);
exit(err);
}
#endif /* SDI_ENDCODE && SDI_ENDCODE_NOCTRLC */
#endif /* SDI_DEFINES_H */