/*============================================================================= * drt/sys/kdefs.h * Common C definitions. * * Usage * This must be the very first file #included by all C source files. * It contains the necessary definitions to correct the deficiencies of * the local C++ compiler. * * See also * kport.h * * History * 1.01, 1998-04-23, David R Tribble. * First cut. * * 1.02, 1998-05-30, David R Tribble. * Changed filename prefix from "j" to "k". * * 1.03, 1999-02-26, David R Tribble. * Moved to drt/sys/. * * 1.04, 1999-03-19, David R Tribble. * Converted from C++ to C. * * Copyright ©1998-1999, by David R. Tribble, all rights reserved. * See "drt/sys/copyr.txt" for more information. *----------------------------------------------------------------------------*/ #ifndef drt_sys_kdefs_h #define drt_sys_kdefs_h 104 #ifdef __cplusplus #error Use "sys/sdefs.hpp" instead of "sys/kdefs.h" for C++ #endif /* Identification */ #ifndef NO_H_IDENT static const char drt_sys_kdefs_h_id[] = "@(#)drt/sys/kdefs.h 1.04"; #endif /* Special includes */ #ifndef drt_sys_kport_h #include "kport.h" /* Defines macros for porting */ #endif /*----------------------------------------------------------------------------- * Local definitions *----------------------------------------------------------------------------*/ /* Porting control macros */ #ifndef DRT_BYTE_HL #error Unknown byte ordering within words (DRT_BYTE_HL) #endif #ifndef DRT_WORD_HL #error Unknown word ordering within longs (DRT_WORD_HL) #endif #ifndef DRT_LONG_HL #error Unknown long ordering within long longs (DRT_LONG_HL) #endif /* Standard keywords and operators */ #ifndef and #define and && #define and_eq &= #define bitand & #define bitor | #define compl ~ #define not ! #define not_eq != #define or || #define or_eq |= #define xor ^ #define xor_eq ^= #endif /* Standard types */ #if not DRT_HAS_BOOL typedef int bool; #endif #ifndef drt_int16_t #define drt_int16_t signed short int /* 16-bit signed integer */ #define drt_uint16_t unsigned short int /* 16-bit unsigned integer */ #endif #ifndef drt_int32_t #define drt_int32_t signed int /* 32-bit signed integer */ #define drt_uint32_t unsigned int /* 32-bit unsigned integer */ #endif #ifndef drt_int64_t #define drt_int64_t signed long long int /* 64-bit signed integer */ #define drt_uint64_t unsigned long long int /* 64-bit unsigned integer */ #endif /* Standard constants */ #if not DRT_HAS_BOOL static const bool false = (bool) 0; static const bool true = (bool) 1; #endif #ifndef NULL #define NULL ((void *) 0) #endif #undef null #define null NULL #ifndef LLONG_MIN #define LLONG_MIN (-9223372036854775807LL-1) #endif #ifndef LLONG_MAX #define LLONG_MAX 9223372036854775807LL #endif #ifndef ULLONG_MAX #define ULLONG_MAX 0xFFFFFFFFFFFFFFFFLLU #endif /* Other constants */ #ifndef DRT_LLONG_FMT #define DRT_LLONG_FMT "ll" #endif /* Other names */ #undef min #undef max #endif /* drt_sys_kdefs_h */ /* End kdefs.h */