Merge pull request #836 from skunkwerks/feature/add-freebsd-debugs
add support for debug flags in FreeBSD
This commit is contained in:
commit
af61ee6f3a
4 changed files with 20 additions and 4 deletions
|
@ -38,6 +38,10 @@
|
|||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
#include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
#include "Constants.hpp"
|
||||
|
||||
#ifdef __LINUX__
|
||||
|
@ -419,8 +423,12 @@ public:
|
|||
static inline uint64_t hton(uint64_t n)
|
||||
{
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#if defined(__GNUC__) && (!defined(__OpenBSD__))
|
||||
#if defined(__GNUC__)
|
||||
#if defined(__FreeBSD__)
|
||||
return bswap64(n);
|
||||
#elif (!defined(__OpenBSD__))
|
||||
return __builtin_bswap64(n);
|
||||
#endif
|
||||
#else
|
||||
return (
|
||||
((n & 0x00000000000000FFULL) << 56) |
|
||||
|
@ -448,8 +456,12 @@ public:
|
|||
static inline uint64_t ntoh(uint64_t n)
|
||||
{
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#if defined(__GNUC__) && !defined(__OpenBSD__)
|
||||
#if defined(__GNUC__)
|
||||
#if defined(__FreeBSD__)
|
||||
return bswap64(n);
|
||||
#elif (!defined(__OpenBSD__))
|
||||
return __builtin_bswap64(n);
|
||||
#endif
|
||||
#else
|
||||
return (
|
||||
((n & 0x00000000000000FFULL) << 56) |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue