diff options
author | Tor Andersson <tor@ghostscript.com> | 2008-09-05 17:13:28 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2008-09-05 17:13:28 +0200 |
commit | d861716137c216dee26b69b606d1189949d97f8d (patch) | |
tree | f94a61ae8cbdba35de800e07eb6d6376fa988d38 /include/fitz/base_runtime.h | |
parent | 226884fcd1c15e1320f2c7677b1356a41870f73f (diff) | |
download | mupdf-d861716137c216dee26b69b606d1189949d97f8d.tar.xz |
Simplify sysdep stuff to support only c99 and msvc.
Diffstat (limited to 'include/fitz/base_runtime.h')
-rw-r--r-- | include/fitz/base_runtime.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/fitz/base_runtime.h b/include/fitz/base_runtime.h index fc7ad920..4bd5cc91 100644 --- a/include/fitz/base_runtime.h +++ b/include/fitz/base_runtime.h @@ -12,26 +12,33 @@ #endif #endif -#undef nil +#ifndef nil #define nil ((void*)0) +#endif -#undef offsetof +#ifndef offsetof #define offsetof(s, m) (unsigned long)(&(((s*)0)->m)) +#endif -#undef nelem +#ifndef nelem #define nelem(x) (sizeof(x)/sizeof((x)[0])) +#endif -#undef ABS +#ifndef ABS #define ABS(x) ( (x) < 0 ? -(x) : (x) ) +#endif -#undef MAX +#ifndef MAX #define MAX(a,b) ( (a) > (b) ? (a) : (b) ) +#endif -#undef MIN +#ifndef MIN #define MIN(a,b) ( (a) < (b) ? (a) : (b) ) +#endif -#undef CLAMP +#ifndef CLAMP #define CLAMP(x,a,b) ( (x) > (b) ? (b) : ( (x) < (a) ? (a) : (x) ) ) +#endif #define MAX4(a,b,c,d) MAX(MAX(a,b), MAX(c,d)) #define MIN4(a,b,c,d) MIN(MIN(a,b), MIN(c,d)) @@ -64,10 +71,6 @@ void fz_printerror(fz_error *eo); void fz_droperror(fz_error *eo); void fz_warn(char *fmt, ...) __printflike(1,2); -#ifdef WIN32 -#define __func__ __FUNCTION__ -#endif - #define fz_throw(...) fz_throwimp(nil, __func__, __FILE__, __LINE__, __VA_ARGS__) #define fz_rethrow(cause, ...) fz_throwimp(cause, __func__, __FILE__, __LINE__, __VA_ARGS__) #define fz_okay ((fz_error*)0) |