SmartPDF - lightweight pdf viewer app for rosapps
[reactos.git] / rosapps / smartpdf / fitz / include / fitz / base_sysdep.h
1 /*
2 * Include the basic standard libc headers.
3 */
4
5 #include <stdlib.h>
6 #include <string.h>
7 #include <assert.h>
8 #include <stdarg.h>
9
10 #include <limits.h> /* INT_MIN, MAX ... */
11 #include <float.h> /* DBL_EPSILON */
12 #include <math.h>
13
14 #include <errno.h>
15 #include <fcntl.h> /* O_RDONLY & co */
16
17 /* not supposed to be here, but printf debugging sorta needs it */
18 #include <stdio.h>
19
20 #ifdef _WIN32
21 # define vsnprintf _vsnprintf
22 # include <io.h>
23 #else
24 # include <unistd.h>
25 #endif
26
27 #ifdef HAVE_C99
28 #define FZ_FLEX
29 #else
30 #define FZ_FLEX 1
31 #define restrict
32
33 #ifdef _MSC_VER
34 #ifndef NDEBUG
35 /*#define inline __inline*/
36 /*#define inline*/
37 #else
38 /*#define inline __inline*/
39 #endif
40 #define FORCEINLINE __forceinline
41 #else
42 #ifdef __GNUC__
43 #undef inline
44 #undef FORCEINLINE
45 #endif
46 #define inline __inline__
47 #define FORCEINLINE __inline__
48 #endif
49 #endif
50
51 #ifndef va_copy
52 #define va_copy(a,b) (a) = (b)
53 #endif
54
55 #ifndef O_BINARY
56 #define O_BINARY 0
57 #endif
58
59 /*
60 * Extras! Extras! Get them while they're hot!
61 */
62
63 #ifdef NEED_MATH
64 #ifdef __GNUC__
65 #undef M_E
66 #undef M_LOG2E
67 #undef M_LOG10E
68 #undef M_LN2
69 #undef M_LN10
70 #undef M_PI
71 #undef M_PI_2
72 #undef M_PI_4
73 #undef M_1_PI
74 #undef M_2_PI
75 #undef M_1_SQRTPI
76 #undef M_2_SQRTPI
77 #undef M_SQRT2
78 #undef M_SQRT_2
79 #endif
80 #define M_E 2.71828182845904523536
81 #define M_LOG2E 1.44269504088896340736
82 #define M_LOG10E 0.434294481903251827651
83 #define M_LN2 0.693147180559945309417
84 #define M_LN10 2.30258509299404568402
85 #define M_PI (float)3.14159265358979323846
86 #define M_PI_2 1.57079632679489661923
87 #define M_PI_4 0.785398163397448309616
88 #define M_1_PI 0.318309886183790671538
89 #define M_2_PI 0.636619772367581343076
90 #define M_1_SQRTPI 0.564189583547756286948
91 #define M_2_SQRTPI 1.12837916709551257390
92 #define M_SQRT2 1.41421356237309504880
93 #define M_SQRT_2 0.707106781186547524401
94 #endif
95
96 #ifdef NEED_STRLCPY
97 extern int strlcpy(char *dst, const char *src, int n);
98 extern int strlcat(char *dst, const char *src, int n);
99 #endif
100
101 #ifdef NEED_STRSEP
102 extern char *strsep(char **stringp, const char *delim);
103 #endif
104
105 #ifdef NEED_GETOPT
106 extern int getopt(int nargc, char * const * nargv, const char *ostr);
107 extern int opterr, optind, optopt;
108 extern char *optarg;
109 #endif