From ecfb80367e891394f5bc0eaf52523b7fc71ab878 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 25 Mar 2014 20:28:20 +0100 Subject: Add va_copy/va_copy_end macros to support both C89 and C99. --- include/mupdf/fitz/system.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h index 41f45245..bf339eb4 100644 --- a/include/mupdf/fitz/system.h +++ b/include/mupdf/fitz/system.h @@ -63,6 +63,15 @@ #ifdef _MSC_VER /* Microsoft Visual C */ +/* MSVC up to VS2012 */ +#if _MSC_VER < 1800 +#define va_copy(a, oa) do { a=oa; } while (0) +#define va_copy_end(a) do {} while(0) +#define strtof(a,b) ((float)strtod((a),(b))) +#else +#define va_copy_end(a) va_end(a) +#endif + typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; @@ -110,9 +119,10 @@ void fz_free_argv(int argc, char **argv); #ifndef O_BINARY #define O_BINARY 0 - #endif +#define va_copy_end(a) va_end(a) + #endif #ifdef __ANDROID__ -- cgit v1.2.3