aruu

[MIRROR] Actual replacement for Busybox | suckless
git clone https://git.daat.foo/aruu.git
Log | Files | Refs | README | LICENSE

sh_cdefs.h (1266B)


      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 #if FEATURE_SH_EXT
     18 #ifndef _DEFAULT_SOURCE
     19 #define _DEFAULT_SOURCE
     20 #endif
     21 #ifndef _GNU_SOURCE
     22 #define _GNU_SOURCE
     23 #endif
     24 #endif
     25 
     26 #ifndef __dead2
     27 #define __dead2 __attribute__((__noreturn__))
     28 #endif
     29 
     30 #ifndef __printf0like
     31 #define __printf0like(n, m) __attribute__((__format__(__printf__, n, m)))
     32 #endif
     33 
     34 #ifndef __printflike
     35 #define __printflike(n, m) __attribute__((__format__(__printf__, n, m)))
     36 #endif
     37 
     38 #ifndef _SH_POINTER_TYPEDEF
     39 #define _SH_POINTER_TYPEDEF
     40 typedef void *pointer; /* used in our memalloc.h and bltin.h
     41                         * canonical home is shell.h, but we
     42                         * want memalloc to be self-contained
     43                         * and not pull all of shell.h */
     44 #endif
     45 
     46 #endif /* SH_CDEFS_H */