Browse Source

backport openbsd support

pull/304/head
orignal 9 years ago
parent
commit
d01a21a867
  1. 2
      I2PEndian.h
  2. 2
      build/CMakeLists.txt
  3. 4
      util.cpp

2
I2PEndian.h

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
#include <inttypes.h>
#include <string.h>
#if defined(__linux__) || defined(__FreeBSD_kernel__)
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
#include <endian.h>
#elif __FreeBSD__
#include <sys/endian.h>

2
build/CMakeLists.txt

@ -130,6 +130,8 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") @@ -130,6 +130,8 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
add_definitions( "-D_GLIBCXX_USE_NANOSLEEP=1" )
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp")
elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonWin32.cpp")
list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/Win32/Win32Service.cpp")

4
util.cpp

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
#include "util.h"
#include "Log.h"
#if defined(__linux__) || defined(__FreeBSD_kernel__)
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__OpenBSD__)
#include <sys/types.h>
#include <ifaddrs.h>
#elif defined(WIN32)
@ -508,7 +508,7 @@ namespace net @@ -508,7 +508,7 @@ namespace net
{
int GetMTU (const boost::asio::ip::address& localAddress)
{
#if defined(__linux__) || defined(__FreeBSD_kernel__)
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__OpenBSD__)
ifaddrs * ifaddr, * ifa = nullptr;
if (getifaddrs(&ifaddr) == -1)
{

Loading…
Cancel
Save