mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-07 03:40:09 +00:00
Merge pull request #836 from skunkwerks/feature/add-freebsd-debugs
add support for debug flags in FreeBSD
This commit is contained in:
commit
af61ee6f3a
@ -76,6 +76,9 @@
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define ZT_THREAD_ID (long)0 // (long)gettid()
|
#define ZT_THREAD_ID (long)0 // (long)gettid()
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#define ZT_THREAD_ID (long)0 // (long)gettid()
|
||||||
|
#endif
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define ZT_THREAD_ID (long)0 //
|
#define ZT_THREAD_ID (long)0 //
|
||||||
#endif
|
#endif
|
||||||
@ -96,7 +99,7 @@
|
|||||||
#define DEBUG_INFO(fmt, ...) fprintf(stderr, ZT_GRN "INFO [%ld]: %17s:%5d:%25s: " fmt "\n" \
|
#define DEBUG_INFO(fmt, ...) fprintf(stderr, ZT_GRN "INFO [%ld]: %17s:%5d:%25s: " fmt "\n" \
|
||||||
ZT_RESET, ZT_THREAD_ID, ZT_FILENAME, __LINE__, __FUNCTION__, __VA_ARGS__)
|
ZT_RESET, ZT_THREAD_ID, ZT_FILENAME, __LINE__, __FUNCTION__, __VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
#if defined(__linux__) or defined(__APPLE__)
|
#if defined(__linux__) or defined(__APPLE__) or defined(__FreeBSD__)
|
||||||
#define DEBUG_INFO(fmt, args ...) fprintf(stderr, ZT_GRN "INFO [%ld]: %17s:%5d:%25s: " fmt "\n" \
|
#define DEBUG_INFO(fmt, args ...) fprintf(stderr, ZT_GRN "INFO [%ld]: %17s:%5d:%25s: " fmt "\n" \
|
||||||
ZT_RESET, ZT_THREAD_ID, ZT_FILENAME, __LINE__, __FUNCTION__, ##args)
|
ZT_RESET, ZT_THREAD_ID, ZT_FILENAME, __LINE__, __FUNCTION__, ##args)
|
||||||
#endif
|
#endif
|
||||||
|
@ -160,7 +160,7 @@ clean:
|
|||||||
rm -rf *.a *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o build-* zerotier-one zerotier-idtool zerotier-selftest zerotier-cli $(ONE_OBJS) $(CORE_OBJS)
|
rm -rf *.a *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o build-* zerotier-one zerotier-idtool zerotier-selftest zerotier-cli $(ONE_OBJS) $(CORE_OBJS)
|
||||||
|
|
||||||
debug: FORCE
|
debug: FORCE
|
||||||
gmake -j 4 ZT_DEBUG=1
|
$(MAKE) -j ZT_DEBUG=1
|
||||||
|
|
||||||
install: one
|
install: one
|
||||||
rm -f /usr/local/sbin/zerotier-one
|
rm -f /usr/local/sbin/zerotier-one
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "Tag.hpp"
|
#include "Tag.hpp"
|
||||||
#include "Capability.hpp"
|
#include "Capability.hpp"
|
||||||
#include "Revocation.hpp"
|
#include "Revocation.hpp"
|
||||||
|
#include "../include/ZeroTierDebug.h"
|
||||||
|
|
||||||
namespace ZeroTier {
|
namespace ZeroTier {
|
||||||
|
|
||||||
|
@ -38,6 +38,10 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#if defined(__FreeBSD__)
|
||||||
|
#include <sys/endian.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "Constants.hpp"
|
#include "Constants.hpp"
|
||||||
|
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
@ -419,8 +423,12 @@ public:
|
|||||||
static inline uint64_t hton(uint64_t n)
|
static inline uint64_t hton(uint64_t n)
|
||||||
{
|
{
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
#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);
|
return __builtin_bswap64(n);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
return (
|
return (
|
||||||
((n & 0x00000000000000FFULL) << 56) |
|
((n & 0x00000000000000FFULL) << 56) |
|
||||||
@ -448,8 +456,12 @@ public:
|
|||||||
static inline uint64_t ntoh(uint64_t n)
|
static inline uint64_t ntoh(uint64_t n)
|
||||||
{
|
{
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
#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);
|
return __builtin_bswap64(n);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
return (
|
return (
|
||||||
((n & 0x00000000000000FFULL) << 56) |
|
((n & 0x00000000000000FFULL) << 56) |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user