forked from abrasive/shairport
-
-
Notifications
You must be signed in to change notification settings - Fork 575
/
definitions.h
46 lines (36 loc) · 984 Bytes
/
definitions.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
#ifndef _DEFINITIONS_H
#define _DEFINITIONS_H
#include <sys/socket.h>
#include "config.h"
#if defined(__APPLE__) && defined(__MACH__)
/* Apple OSX and iOS (Darwin). ------------------------------ */
#include <TargetConditionals.h>
#if TARGET_OS_MAC == 1
/* OSX */
#define COMPILE_FOR_OSX 1
#endif
#endif
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
#define COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN_AND_OPENBSD 1
#endif
#if defined(__linux__)
#define COMPILE_FOR_LINUX 1
#endif
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#define COMPILE_FOR_BSD 1
#endif
#if defined(__FreeBSD__)
#define COMPILE_FOR_FREEBSD 1
#endif
#if defined(__OpenBSD__)
#define COMPILE_FOR_OPENBSD 1
#endif
// struct sockaddr_in6 is bigger than struct sockaddr. derp
#ifdef AF_INET6
#define SOCKADDR struct sockaddr_storage
#define SAFAMILY ss_family
#else
#define SOCKADDR struct sockaddr
#define SAFAMILY sa_family
#endif
#endif // _DEFINITIONS_H