]>
git.ipfire.org Git - location/libloc.git/blob - src/loc/compat.h
2 libloc - A library to determine the location of someone on the Internet
4 Copyright (C) 2019 IPFire Development Team <info@ipfire.org>
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.
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.
17 #ifndef LIBLOC_COMPAT_H
18 #define LIBLOC_COMPAT_H
21 /* Hacks to make this library compile on Mac OS X */
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)
32 # define s6_addr16 __u6_addr.__u6_addr16
35 # define s6_addr32 __u6_addr.__u6_addr32