From 79d13eb6cbe9ce7e85ac36fde157b6b56109c715 Mon Sep 17 00:00:00 2001 From: Mikal Villa Date: Sat, 3 Jan 2015 21:33:27 +0100 Subject: [PATCH] Fix Mac OSX build error. --- Makefile.osx | 7 ++++++- SOCKS.h | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Makefile.osx b/Makefile.osx index 9d3d2e46..7af2247b 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -1,10 +1,15 @@ CXX = clang++ -CXXFLAGS = -g -Wall -std=c++11 -DCRYPTOPP_DISABLE_ASM +CXXFLAGS = -g -Wall -std=c++11 -DCRYPTOPP_DISABLE_ASM -DMAC_OSX #CXXFLAGS = -g -O2 -Wall -std=c++11 -DCRYPTOPP_DISABLE_ASM INCFLAGS = -I/usr/local/include LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread +ifeq ($(USE_UPNP),1) + LDFLAGS += -ldl + CXXFLAGS += -DUSE_UPNP +endif + # OSX Notes # http://www.hutsby.net/2011/08/macs-with-aes-ni.html # Seems like all recent Mac's have AES-NI, after firmware upgrade 2.2 diff --git a/SOCKS.h b/SOCKS.h index a0a6a9a2..9c77a703 100644 --- a/SOCKS.h +++ b/SOCKS.h @@ -8,6 +8,19 @@ #include "Streaming.h" #include "I2PTunnel.h" +#ifdef MAC_OSX + /* + * - MAXHOSTNAMELEN from + * on MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, + * IRIX 6.5, OSF/1 5.1, Interix 3.5, Haiku, + * - MAXHOSTNAMELEN from + * on Solaris 10, Cygwin, BeOS, + * - 256 on mingw. + * + * */ +#define HOST_NAME_MAX 256 +#endif + namespace i2p { namespace proxy