aa2a33dfe9b9373f09b7f5049049115f5d90f207
2 +--------------------------------------------------------------------+
3 | libmemcached - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020 Michael Wallner <mike@php.net> |
13 +--------------------------------------------------------------------+
16 #include "mem_config.h"
17 #include "libmemcached/byteorder.h"
19 /* Byte swap a 64-bit number. */
22 static inline uint64_t swap64(uint64_t in
) {
24 /* Little endian, flip the bytes around until someone makes a faster/better
27 for (uint8_t x
= 0; x
< 8; ++x
) {
28 rv
= (rv
<< 8) | (in
& 0xff);
33 /* big-endian machines don't need byte swapping */
35 # endif // WORDS_BIGENDIAN
40 #include <sys/types.h>
42 uint64_t memcached_ntohll(uint64_t value
) {
50 uint64_t memcached_htonll(uint64_t value
) {