summaryrefslogtreecommitdiff
path: root/include/fitz/sysdep.h
blob: f31256017a637a17b2053265cdc2a9c6afee5725 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Include the basic standard libc headers.
 */

#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdarg.h>

#include <limits.h>	/* INT_MIN, MAX ... */
#include <float.h>	/* DBL_EPSILON */
#include <math.h>

#ifdef WIN32
#define NEED_STRLCPY
#define NEED_STRSEP
#define NEED_GETOPT
#define M_PI 3.14159265358979323846
#define inline __inline
#define vsnprintf _vsnprintf
#endif

#include <errno.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include <fcntl.h>	/* O_RDONLY & co */

/* not supposed to be here, but printf debugging sorta needs it */
#include <stdio.h>

/*
 * Extras! Extras! Get them while they're hot!
 */

#ifdef NEED_STRLCPY
extern int strlcpy(char *dst, const char *src, int n);
extern int strlcat(char *dst, const char *src, int n);
#endif

#ifdef NEED_STRSEP
extern char *strsep(char **stringp, const char *delim);
#endif

#ifdef NEED_GETOPT
extern int getopt(int nargc, char * const * nargv, const char *ostr);
extern int opterr, optind, optopt;
extern char *optarg;
#endif