]> git.ipfire.org Git - location/libloc.git/blame - src/loc/compat.h
Merge branch 'apple'
[location/libloc.git] / src / loc / compat.h
CommitLineData
42f3ccd7
MT
1/*
2 libloc - A library to determine the location of someone on the Internet
3
4 Copyright (C) 2019 IPFire Development Team <info@ipfire.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15*/
16
17#ifndef LIBLOC_COMPAT_H
18#define LIBLOC_COMPAT_H
19
20#ifdef __APPLE__
21/* Hacks to make this library compile on Mac OS X */
22
23#include <libkern/OSByteOrder.h>
24#define be16toh(x) OSSwapBigToHostInt16(x)
25#define htobe16(x) OSSwapHostToBigInt16(x)
26#define be32toh(x) OSSwapBigToHostInt32(x)
27#define htobe32(x) OSSwapHostToBigInt32(x)
28#define be64toh(x) OSSwapBigToHostInt64(x)
29#define htobe64(x) OSSwapHostToBigInt64(x)
30
31#ifndef s6_addr16
32# define s6_addr16 __u6_addr.__u6_addr16
33#endif
34#ifndef s6_addr32
35# define s6_addr32 __u6_addr.__u6_addr32
36#endif
37
38#endif
39
40#endif