summaryrefslogtreecommitdiff
path: root/src/include/skalibs/bsdsnowflake.h
blob: 97186d248f3b8f31c407f37c50841bbac74f95f6 (plain)
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
/* ISC license. */

#ifndef SKALIBS_BSDSNOWFLAKE_H
#define SKALIBS_BSDSNOWFLAKE_H

 /*
   Like skalibs/nonposix.h, this header is supposed to be included
   *before* system headers.
   Unlike skalibs/nonposix.h, though, it does not define ftms that
   enable non-portable behaviour; it just attempts to work around
   blatant brokenness, things that actually ARE defined by POSIX
   but where OSes just ignore the spec.
   The BSDs are experts at this, hence the name.
 */


#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DragonFly__)

 /* BSDs: the eponym.
    Sometimes you just need to recognize who they are and what they do. */

#ifndef SKALIBS_BSD_SUCKS
#define SKALIBS_BSD_SUCKS
#endif

 /* Other times you just need to say you're a BSD so they deign
    to define symbols like EOVERFLOW. Give me my POSIX symbols,
    pretty please? */

#ifndef _BSD_SOURCE
#define _BSD_SOURCE
#endif

#endif


#if defined(__APPLE__) && defined(__MACH__)

 /* MacOS: needs this for full SUSv3 conformance. That's how you
    can tell it's really a BSD inside. With additional layers of crap. */

#ifndef _DARWIN_C_SOURCE
#define _DARWIN_C_SOURCE
#endif

#endif /* __APPLE__ && __MACH__ */

#endif /* SKALIBS_BSDSNOWFLAKE_H */