1 /*
2  * stdinc.h
3  * pull in standard headers (including portability hacks)
4  *
5  * Copyright (c) 2012 pkgconf authors (see AUTHORS).
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * This software is provided 'as is' and without any warranty, express or
12  * implied.  In no event shall the authors be liable for any damages arising
13  * from the use of this software.
14  */
15 
16 #ifndef LIBPKGCONF_STDINC_H
17 #define LIBPKGCONF_STDINC_H
18 
19 #include <ctype.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <stddef.h>
23 #include <stdbool.h>
24 #include <stdarg.h>
25 #include <string.h>
26 #include <sys/types.h>
27 #include <stdint.h>
28 
29 #ifdef _WIN32
30 # define WIN32_LEAN_AND_MEAN
31 # include <windows.h>
32 # include <malloc.h>
33 # define PATH_DEV_NULL	"nul"
34 # ifdef _WIN64
35 #  define SIZE_FMT_SPECIFIER	"%I64u"
36 # else
37 #  define SIZE_FMT_SPECIFIER	"%u"
38 # endif
39 # ifndef ssize_t
40 # ifndef __MINGW32__
41 #  include <BaseTsd.h>
42 # else
43 #  include <basetsd.h>
44 # endif
45 #  define ssize_t SSIZE_T
46 # endif
47 # ifndef __MINGW32__
48 #  include "win-dirent.h"
49 # else
50 # include <dirent.h>
51 # endif
52 # define PKGCONF_ITEM_SIZE (_MAX_PATH + 1024)
53 #else
54 # define PATH_DEV_NULL	"/dev/null"
55 # define SIZE_FMT_SPECIFIER	"%zu"
56 # ifdef __HAIKU__
57 #  include <FindDirectory.h>
58 # endif
59 # include <dirent.h>
60 # include <unistd.h>
61 # include <limits.h>
62 # ifdef PATH_MAX
63 #  define PKGCONF_ITEM_SIZE (PATH_MAX + 1024)
64 # else
65 #  define PKGCONF_ITEM_SIZE (4096 + 1024)
66 # endif
67 #endif
68 
69 #endif
70