-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompats.h
108 lines (89 loc) · 1.67 KB
/
compats.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#if __STDC__ || HAVE_VOID_PTR
#define VOID void
#else
#define VOID char
#endif
#ifndef __dead
# define __dead
#endif
#ifndef HAVE_REALLOCARRAY
extern VOID *reallocarray ();
#endif /* HAVE_REALLOCARRAY */
#ifdef HAVE_ERR_H
# include <err.h>
#else
extern __dead void errx ();
extern __dead void err ();
extern __dead void warnx ();
extern __dead void warn ();
#endif /* HAVE_ERR_H */
#ifdef HAVE_FNMATCH_H
# include <fnmatch.h>
#else
extern fnmatch ();
#endif
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#else
extern char *basename ();
extern char *dirname ();
#endif /* HAVE_LIBGEN_H */
#ifndef HAVE_STRDUP
extern char *strdup ();
#endif
#ifndef WORKS_STRSEP
# if HAVE_STRSEP
# define strsep xstrsep
# endif
extern char *strsep ();
#endif
#ifndef HAVE_TIMESPEC
struct timespec {
time_t tv_sec;
long tv_nsec;
};
#endif
#ifndef HAVE_REALPATH
extern char *realpath ();
#endif
#ifndef HAVE_FMEMOPEN
extern FILE *fmemopen ();
#endif
#ifndef HAVE_MEMMOVE
extern void *memmove ();
#endif
#ifndef WIFEXITED
# define WIFEXITED(ws) (((ws) & 0x00ff) == 0x0000)
#endif
#ifndef WEXITSTATUS
# if HAVE_UNION_WAIT
# define WEXITSTATUS(ws) ((ws).w_retcode)
# else
# define WEXITSTATUS(ws) (((ws) >> 8) & 0xff)
# endif
#endif
#ifndef PATH_MAX
# ifdef _POSIX_PATH_MAX
# define PATH_MAX _POSIX_PATH_MAX
# else
# define PATH_MAX 256
# endif
#endif
#ifndef STDIN_FILENO
# define STDIN_FILENO 0
#endif
#ifndef STDOUT_FILENO
# define STDOUT_FILENO 1
#endif
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
#ifndef HAVE_LSTAT
# define lstat(fd, st) (stat ((fd), (st)))
#endif
#ifndef HAVE_STDLIB_H
extern VOID *malloc ();
extern VOID *calloc ();
extern VOID *realloc ();
extern char *getenv ();
#endif