Imported Upstream version 3.2.4
[platform/upstream/ccache.git] / system.h
1 /*
2  * Copyright (C) 2010-2015 Joel Rosdahl
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the Free
6  * Software Foundation; either version 3 of the License, or (at your option)
7  * any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc., 51
16  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18
19 #ifndef CCACHE_SYSTEM_H
20 #define CCACHE_SYSTEM_H
21
22 #include "config.h"
23
24 #include <sys/file.h>
25 #ifdef HAVE_SYS_MMAN_H
26 #include <sys/mman.h>
27 #endif
28 #include <sys/stat.h>
29 #include <sys/types.h>
30 #ifdef HAVE_SYS_WAIT_H
31 #include <sys/wait.h>
32 #endif
33
34 #include <assert.h>
35 #include <ctype.h>
36 #include <dirent.h>
37 #include <errno.h>
38 #include <fcntl.h>
39 #include <inttypes.h>
40 #include <limits.h>
41 #include <signal.h>
42 #include <stdarg.h>
43 #include <stddef.h>
44 #include <stdio.h>
45 #include <stdlib.h>
46 #include <string.h>
47 #include <strings.h>
48 #include <time.h>
49 #include <unistd.h>
50 #include <utime.h>
51
52 extern char **environ;
53
54 #if !HAVE_VSNPRINTF
55   int rpl_vsnprintf(char *, size_t, const char *, va_list);
56   #define vsnprintf rpl_vsnprintf
57 #endif
58 #if !HAVE_SNPRINTF
59   int rpl_snprintf(char *, size_t, const char *, ...);
60   #define snprintf rpl_snprintf
61 #endif
62 #if !HAVE_VASPRINTF
63   int rpl_vasprintf(char **, const char *, va_list);
64   #define vasprintf rpl_vasprintf
65 #endif
66 #if !HAVE_ASPRINTF
67   int rpl_asprintf(char **, const char *, ...);
68   #define asprintf rpl_asprintf
69 #endif
70
71 #ifdef HAVE_STDBOOL_H
72 #  include <stdbool.h>
73 #else
74 #  ifndef HAVE__BOOL
75 #    ifdef __cplusplus
76 typedef bool _Bool;
77 #    else
78 #      define _Bool signed char
79 #    endif
80 #  endif
81 #  define bool _Bool
82 #  define false 0
83 #  define true 1
84 #  define __bool_true_false_are_defined 1
85 #endif
86
87 #endif /* CCACHE_SYSTEM_H */