summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2004-12-26 20:46:25 +0100
committerTor Andersson <tor@ghostscript.com>2004-12-26 20:46:25 +0100
commitc76a3d84a81c59f880ecac26bf4935e1bb76afc1 (patch)
tree96efece94bbac82b9065ad12437012b7789e5749 /include
parentfb12e1716d653cce57b7b6acfa16c44c748969b4 (diff)
downloadmupdf-c76a3d84a81c59f880ecac26bf4935e1bb76afc1.tar.xz
fixes to compile under mingw/msys
Diffstat (limited to 'include')
-rw-r--r--include/fitz/sysdep.h52
1 files changed, 21 insertions, 31 deletions
diff --git a/include/fitz/sysdep.h b/include/fitz/sysdep.h
index 79948d80..4e8b1115 100644
--- a/include/fitz/sysdep.h
+++ b/include/fitz/sysdep.h
@@ -15,24 +15,36 @@
#include <fcntl.h> /* O_RDONLY & co */
#ifdef HAVE_C99
+# define FZ_FLEX
+#else
+# define FZ_FLEX 1
+# define restrict
+# define inline __inline__
+#endif
-#define FZ_FLEX
-
+#ifdef WIN32
+# define vsnprintf _vsnprintf
+# include <io.h>
#else
+# include <unistd.h>
+#endif
-#define FZ_FLEX 1
-#define restrict
-#define inline __inline__
+#ifndef va_copy
#define va_copy(a,b) (a) = (b)
+#endif
+#ifndef O_BINARY
+#define O_BINARY 0
#endif
-#ifdef WIN32
+/*
+ * Extras! Extras! Get them while they're hot!
+ */
-#define NEED_STRLCPY
-#define NEED_STRSEP
-#define NEED_GETOPT
+/* not supposed to be here, but printf debugging sorta needs it */
+#include <stdio.h>
+#ifdef NEED_MATH
#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
@@ -47,30 +59,8 @@
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT_2 0.707106781186547524401
-
-#define va_copy(a,b) (a) = (b)
-#define inline __inline
-#define vsnprintf _vsnprintf
-
-#include <io.h>
-
-#else
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-#include <unistd.h>
-
#endif
-/*
- * Extras! Extras! Get them while they're hot!
- */
-
-/* not supposed to be here, but printf debugging sorta needs it */
-#include <stdio.h>
-
#ifdef NEED_STRLCPY
extern int strlcpy(char *dst, const char *src, int n);
extern int strlcat(char *dst, const char *src, int n);