]> git.ipfire.org Git - thirdparty/shairport-sync.git/blob - definitions.h
Update RELEASENOTES-DEVELOPMENT.md
[thirdparty/shairport-sync.git] / definitions.h
1 #ifndef _DEFINITIONS_H
2 #define _DEFINITIONS_H
3
4 #include <sys/socket.h>
5
6 #include "config.h"
7
8 #if defined(__APPLE__) && defined(__MACH__)
9 /* Apple OSX and iOS (Darwin). ------------------------------ */
10 #include <TargetConditionals.h>
11 #if TARGET_OS_MAC == 1
12 /* OSX */
13 #define COMPILE_FOR_OSX 1
14 #endif
15 #endif
16
17 #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
18 #define COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN_AND_OPENBSD 1
19 #endif
20
21 #if defined(__linux__)
22 #define COMPILE_FOR_LINUX 1
23 #endif
24
25 #if defined(__FreeBSD__) || defined(__OpenBSD__)
26 #define COMPILE_FOR_BSD 1
27 #endif
28
29 #if defined(__FreeBSD__)
30 #define COMPILE_FOR_FREEBSD 1
31 #endif
32
33 // struct sockaddr_in6 is bigger than struct sockaddr. derp
34 #ifdef AF_INET6
35 #define SOCKADDR struct sockaddr_storage
36 #define SAFAMILY ss_family
37 #else
38 #define SOCKADDR struct sockaddr
39 #define SAFAMILY sa_family
40 #endif
41
42 #endif // _DEFINITIONS_H