Patches from Piotr Sikora < piotr.sikora@frickle.com > for OpenBSD.
[m6w6/libmemcached] / libmemcached / byteorder.h
1 /* LibMemcached
2 * Copyright (C) 2006-2009 Brian Aker
3 * All rights reserved.
4 *
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
7 *
8 * Summary:
9 *
10 */
11
12 #ifndef __LIBMEMCACHED_BYTEORDER_H__
13 #define __LIBMEMCACHED_BYTEORDER_H__
14
15 #include "config.h"
16
17 #if HAVE_SYS_TYPES_H
18 #include <sys/types.h>
19 #endif
20
21
22 /* Define this here, which will turn on the visibilty controls while we're
23 * building libmemcached.
24 */
25 #define BUILDING_LIBMEMCACHED 1
26
27 #include "libmemcached/memcached.h"
28
29 #ifndef HAVE_HTONLL
30 LIBMEMCACHED_LOCAL
31 uint64_t ntohll(uint64_t);
32 LIBMEMCACHED_LOCAL
33 uint64_t htonll(uint64_t);
34 #endif
35
36 #ifdef linux
37 /* /usr/include/netinet/in.h defines macros from ntohs() to _bswap_nn to
38 * optimize the conversion functions, but the prototypes generate warnings
39 * from gcc. The conversion methods isn't the bottleneck for my app, so
40 * just remove the warnings by undef'ing the optimization ..
41 */
42 #undef ntohs
43 #undef ntohl
44 #undef htons
45 #undef htonl
46 #endif
47
48 #endif /*__LIBMEMCACHED_BYTEORDER_H__ */