From f58b5924a54fbef69de33dbb0340d1bf9f4fd237 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 13 Aug 2012 17:00:43 +0100 Subject: alter file fetcher to use mmap where available --- utils/utils.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'utils/utils.h') diff --git a/utils/utils.h b/utils/utils.h index 02bf75fea..f3dba449f 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -32,26 +32,38 @@ #ifndef NOF_ELEMENTS #define NOF_ELEMENTS(array) (sizeof(array)/sizeof(*(array))) #endif + #ifndef ABS #define ABS(x) (((x)>0)?(x):(-(x))) #endif + #ifdef __MINT__ /* avoid using GCCs builtin min/max functions */ #undef min #undef max #endif + #ifndef min #define min(x,y) (((x)<(y))?(x):(y)) #endif + #ifndef max #define max(x,y) (((x)>(y))?(x):(y)) #endif + #ifndef PRIxPTR #define PRIxPTR "x" #endif + #ifndef PRId64 #define PRId64 "lld" #endif +#if defined(_WIN32) +#define SSIZET_FMT "Iu" +#else +#define SSIZET_FMT "zd" +#endif + #if defined(__GNUC__) && (__GNUC__ < 3) #define FLEX_ARRAY_LEN_DECL 0 #else -- cgit v1.2.3