1/* -
2 * compat defs for non-bsds
3 *
4 * __unused and __nonstring are intentionally NOT defined here
5 * they collide with struct field names in some libc's <bits/stat.h>
6 * (`long __unused[3]`) and similar system headers when defined as
7 * macros before those headers are included. they remain defined in
8 * shell.h, which includes <sys/stat.h> before defining them
9 *
10 * all definitions are guarded with #ifndef so they do not conflict
11 * with each other or with system-provided definitions
12 */
13
14#ifndef SH_CDEFS_H
15#define SH_CDEFS_H
16
17#ifndef __dead2
18#define __dead2 __attribute__((__noreturn__))
19#endif
20
21#ifndef __printf0like
22#define __printf0like(n, m) __attribute__((__format__(__printf__, n, m)))
23#endif
24
25#ifndef __printflike
26#define __printflike(n, m) __attribute__((__format__(__printf__, n, m)))
27#endif
28
29#ifndef _SH_POINTER_TYPEDEF
30#define _SH_POINTER_TYPEDEF
31typedef void *pointer; /* used in our memalloc.h and bltin.h
32 * canonical home is shell.h, but we
33 * want memalloc to be self-contained
34 * and not pull all of shell.h */
35#endif
36
37#endif /* SH_CDEFS_H */