summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-05-21 11:55:40 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-06-02 02:08:17 +0200
commit9920e40365821fbef6c3050695b3dcf0fa5f512e (patch)
treef72b7ecc38c4db8c5778261ecfd1b074e2d65b3b
parent928b43eab613970ebe6448b294bba866d43d12bd (diff)
downloadmupdf-9920e40365821fbef6c3050695b3dcf0fa5f512e.tar.xz
Fix include file ifdefs when building with -std=c11.
-rw-r--r--include/mupdf/fitz/system.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h
index c480bd7c..cabbcc21 100644
--- a/include/mupdf/fitz/system.h
+++ b/include/mupdf/fitz/system.h
@@ -57,11 +57,13 @@ typedef unsigned __int64 uint64_t;
Some differences in libc can be smoothed over
*/
-#ifdef __APPLE__
+#ifndef __STRICT_ANSI__
+#if defined(__APPLE__)
#define HAVE_SIGSETJMP
-#elif defined(__unix) && !defined(__NACL__)
+#elif defined(__unix)
#define HAVE_SIGSETJMP
#endif
+#endif
/*
Where possible (i.e. on platforms on which they are provided), use
@@ -147,10 +149,10 @@ void fz_free_argv(int argc, char **argv);
/* inline is standard in C++. For some compilers we can enable it within C too. */
#ifndef __cplusplus
-#if __STDC_VERSION__ == 199901L /* C99 */
-#elif _MSC_VER >= 1500 /* MSVC 9 or newer */
+#if defined (__STDC_VERSION_) && (__STDC_VERSION__ >= 199901L) /* C99 */
+#elif defined(_MSC_VER) && (_MSC_VER >= 1500) /* MSVC 9 or newer */
#define inline __inline
-#elif __GNUC__ >= 3 /* GCC 3 or newer */
+#elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC 3 or newer */
#define inline __inline
#else /* Unknown or ancient */
#define inline
@@ -158,10 +160,10 @@ void fz_free_argv(int argc, char **argv);
#endif
/* restrict is standard in C99, but not in all C++ compilers. */
-#if __STDC_VERSION__ == 199901L /* C99 */
-#elif _MSC_VER >= 1600 /* MSVC 10 or newer */
+#if defined (__STDC_VERSION_) && (__STDC_VERSION__ >= 199901L) /* C99 */
+#elif defined(_MSC_VER) && (_MSC_VER >= 1600) /* MSVC 10 or newer */
#define restrict __restrict
-#elif __GNUC__ >= 3 /* GCC 3 or newer */
+#elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC 3 or newer */
#define restrict __restrict
#else /* Unknown or ancient */
#define restrict
@@ -179,7 +181,7 @@ void fz_free_argv(int argc, char **argv);
#endif
/* Flag unused parameters, for use with 'static inline' functions in headers. */
-#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+#if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7)
#define FZ_UNUSED __attribute__((__unused__))
#else
#define FZ_UNUSED
@@ -189,7 +191,7 @@ void fz_free_argv(int argc, char **argv);
#ifdef __printflike
#define FZ_PRINTFLIKE(F,V) __printflike(F,V)
#else
-#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+#if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7)
#define FZ_PRINTFLIKE(F,V) __attribute__((__format__ (__printf__, F, V)))
#else
#define FZ_PRINTFLIKE(F,V)