// C++ code Copyright (C) David R. Evans G4AMJ/NQ0I

#ifndef DEFINESH
#define DEFINESH

// all the easy stuff first
typedef unsigned char boolean;
typedef unsigned char byte;
typedef unsigned char octet;

#define then

inline int ODD(const int n) { return (n % 2); }
inline int EVEN(const int n) { return !ODD(n); }

#define reveal(type, name, internalname) \
  inline type name (void) const \
    { return (internalname) ; }

#define check_stack(x, y) _CST(x, y, __FILE__, __LINE__)
#define heap_check(x) _HC(x, __FILE__, __LINE__)
#define fatal_error(x) _FE(x, __FILE__, __LINE__)
#define nonfatal_error(x) _NFE(x, __FILE__, __LINE__)
#define warning(x) _NFE(x, __FILE__, __LINE__)
#define TEST(x, y, z) _TST(x, y, z, __FILE__, __LINE__)

extern void _FE(const char*, const char*, const int);
extern void _HC(void*, const char*, const int);
extern void _NFE(const char*, const char*, const int);

#ifdef TRACE
#define dre_trace(x) _TRACELOG(x, __FILE__, __LINE__)
#else
#define dre_trace(x)
#endif

extern void _TRACELOG(const char*, const char*, const int);

extern void information(const char*);

// now the stuff that depends on machines and compilers
#if (defined(WIN31))
#include <defs_win.h>
#endif

#if (defined(__BORLANDC__) && (!defined(_Windows)))
#include <defs_dos.h>
#endif

#if (defined(__GNUC__))
#include <defs_sun.h>
#endif

#if (defined(macintosh))
#include <defs_mac.h>
#endif

#endif
