// disx.h #ifndef _DISX_H_ #define _DISX_H_ #if defined(__clang__) // disable unwanted warnings for xcode #pragma clang diagnostic ignored "-Wshorten-64-to-32" #endif // fallthrough annotation to prevent warnings #if defined(__clang__) && __cplusplus >= 201103L #define FALLTHROUGH [[clang::fallthrough]] #elif defined(_MSC_VER) #include #define FALLTHROUGH __fallthrough #elif defined(__GNUC__) && __GNUC__ >= 7 #define FALLTHROUGH __attribute__ ((fallthrough)) #elif defined (__has_cpp_attribute) #if __has_cpp_attribute(fallthrough) #define FALLTHROUGH [[fallthrough]] #else // default version #define FALLTHROUGH ((void)0) #endif #else // default version #define FALLTHROUGH ((void)0) #endif /* __GNUC__ >= 7 */ // headers for everybody #include #include #include #include #include #include // asserts support, will move NDEBUG to makefile later #if 1 // custom assert, may not work on some environments #include "disassert.h" #else #include #endif //#define NDEBUG // "void func(int UNUSED name)" for unused parameters // this looks better than #define UNUSED(x) (void)(x) #define UNUSED __attribute__((unused)) // define a type for addresses (could maybe also use ofs_t) typedef long addr_t; #endif // _DISX_H_