Build fixes for FreeBSD

This commit is contained in:
Joseph Henry
2017-06-08 16:09:11 -07:00
parent 4232dd703f
commit f5de570334
5 changed files with 12 additions and 6 deletions

View File

@@ -67,11 +67,17 @@
#define ZT_FILENAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) // short
/*
#ifdef __linux__
#define ZT_THREAD_ID 0 // (long)getpid()
#elif __FreeBSD__
#define ZT_THREAD_ID 0 // (long)getpid()
#elif __APPLE__
#define ZT_THREAD_ID 0 // (long)syscall(SYS_thread_selfid)
#endif
*/
#define ZT_THREAD_ID 0
#if defined(__JNI_LIB__)
#include <jni.h>

View File

@@ -167,7 +167,7 @@ tests: unit_tests
##############################################################################
picotcp:
cd $(PICO_DIR); make lib ARCH=shared IPV4=1 IPV6=1
cd $(PICO_DIR); gmake lib ARCH=shared IPV4=1 IPV6=1
##############################################################################
## Static Libraries ##
@@ -176,7 +176,7 @@ picotcp:
static_lib: picotcp $(ZTO_OBJS)
@mkdir -p $(BUILD)
$(CXX) $(CXXFLAGS) $(TAP_FILES) $(STACK_DRIVER_FILES) -c -DSDK_STATIC
ar rcs -o $(STATIC_LIB) ext/picotcp/build/modules/*.o $(PICO_OBJS) $(ZTO_OBJS) $(SDK_OBJS)
ar rcs $(STATIC_LIB) ext/picotcp/build/modules/*.o $(PICO_OBJS) $(ZTO_OBJS) $(SDK_OBJS)
##############################################################################
## Java JNI ##

View File

@@ -32,6 +32,7 @@
#include <unistd.h>
#include <errno.h>
/*
void zt_dump_stacktrace(int sig) {
void *array[16];
size_t size;
@@ -40,6 +41,7 @@ void zt_dump_stacktrace(int sig) {
backtrace_symbols_fd(array, size, STDERR_FILENO);
exit(1);
}
*/
/*
char *beautify_pico_error(int err)

View File

@@ -30,6 +30,6 @@
/*
* Print a stacktrace
*/
void zt_dump_stacktrace(int sig);
// void zt_dump_stacktrace(int sig);
#endif

View File

@@ -419,10 +419,8 @@ namespace ZeroTier {
//DEBUG_INFO("recv = %d", err);
tap->pico_frame_rxbuf_tot-=len;
}
else {
else
DEBUG_ERROR("Invalid frame size (%d). Exiting.",len);
zt_dump_stacktrace(0);
}
loop_score--;
}
return loop_score;