diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2012-08-13 17:00:43 +0100 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2012-08-13 17:00:43 +0100 |
commit | f58b5924a54fbef69de33dbb0340d1bf9f4fd237 (patch) | |
tree | 785c5952dfec9dfc2604badc54793e3816f5c1f8 /utils | |
parent | 8e8c75cfe308e2fff277fbb3043fa850211f79b8 (diff) | |
download | netsurf-f58b5924a54fbef69de33dbb0340d1bf9f4fd237.tar.gz netsurf-f58b5924a54fbef69de33dbb0340d1bf9f4fd237.tar.bz2 |
alter file fetcher to use mmap where available
Diffstat (limited to 'utils')
-rw-r--r-- | utils/config.h | 14 | ||||
-rw-r--r-- | utils/utils.h | 12 |
2 files changed, 16 insertions, 10 deletions
diff --git a/utils/config.h b/utils/config.h index 60b81967a..76142eeb6 100644 --- a/utils/config.h +++ b/utils/config.h @@ -90,6 +90,10 @@ char *realpath(const char *path, char *resolved_path); #undef HAVE_STDOUT #endif +#define HAVE_MMAP +#if (defined(_WIN32) || defined(riscos) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__)) +#undef HAVE_MMAP +#endif /* This section toggles build options on and off. * Simply undefine a symbol to turn the relevant feature off. @@ -127,14 +131,4 @@ char *realpath(const char *path, char *resolved_path); #define NO_IPV6 #endif -/* windows */ -#if (defined(_WIN32)) -#define SSIZET_FMT "Iu" -#elif (defined(riscos)) -#define SSIZET_FMT "zd" -#else -#define SSIZET_FMT "zd" -#define O_BINARY 0 -#endif - #endif 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 |