mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
backport openbsd support
This commit is contained in:
parent
5d43052c05
commit
d01a21a867
|
@ -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>
|
||||
|
|
|
@ -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
4
util.cpp
|
@ -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
|
|||
{
|
||||
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…
Reference in a new issue