1 #ifndef _OPENNET_CFG_H 2 #define _OPNNEET_CFG_H 3 4 #ifdef HAVE_CONFIG_H 5 #include "config.h" 6 #endif 7 #include "win32.h" 8 9 #ifdef HAVE_STRING_H 10 #include <string.h> 11 #endif 12 13 #ifndef HAVE_UNAME 14 #include "uname.h" 15 #endif 16 17 #ifdef HAVE_STDINT_H 18 #include <stdint.h> 19 #endif 20 21 #ifdef HAVE_INTTYPES_H 22 #include <inttypes.h> 23 #endif 24 25 #ifdef HAVE_SYS_TYPES_H 26 #include <sys/types.h> 27 #endif 28 29 30 #ifdef DEBUG 31 #define PRINT_LINE fprintf(stderr, "%lu:%s:%i:%s(): ", (unsigned long) time(NULL), __FILE__, __LINE__, __func__); 32 #define PRINTERR_D(x...) { PRINT_LINE; fprintf(stderr, x); fprintf(stderr, "\n"); } 33 #define PERROR(x) { PRINT_LINE; perror(x); } 34 #define DPERROR(x) PERROR(x) 35 #else 36 #define PRINT_LINE /**/ 37 #define PRINTERR_D(x...) /**/ 38 #define PERROR(x) perror(x); 39 #define DPERROR(x) /**/ 40 #endif 41 #define CHECKPOINT PRINTERR_D("*** CHECKPOINT REACHED ***") 42 #define SPOTVAR_LLX(x) PRINTERR_D(#x " = %llx", (unsigned long long) x) 43 #define SPOTVAR_LLU(x) PRINTERR_D(#x " = %llu", (unsigned long long) x) 44 #define SPOTVAR_LU(x) PRINTERR_D(#x " = %lu", (unsigned long) x) 45 #define SPOTVAR_D(x) PRINTERR_D(#x " = %lf", (double) x) 46 #define SPOTVAR_X(x) PRINTERR_D(#x " = 0x%x", (unsigned int) x) 47 #define SPOTVAR_I(x) PRINTERR_D(#x " = %i", (int) x) 48 #define SPOTVAR_P(x) PRINTERR_D(#x " = %p", (void *) x) 49 #define SPOTVAR_S(x) PRINTERR_D(#x " = \"%s\"", (char *) x) 50 51 52 #endif |