Merge remote branch 'mikedld/remove-macosx-macro'
This commit is contained in:
commit
78d32ba012
|
@ -36,7 +36,7 @@ else (NOT WIN32)
|
||||||
endif (NOT WIN32)
|
endif (NOT WIN32)
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
add_definitions (-DMACOSX -D_DARWIN_C_SOURCE)
|
add_definitions (-D_DARWIN_C_SOURCE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Set compiler specific build flags
|
# Set compiler specific build flags
|
||||||
|
|
|
@ -85,7 +85,7 @@ LIBRARY = libminiupnpc.a
|
||||||
ifeq ($(OS), Darwin)
|
ifeq ($(OS), Darwin)
|
||||||
SHAREDLIBRARY = libminiupnpc.dylib
|
SHAREDLIBRARY = libminiupnpc.dylib
|
||||||
SONAME = $(basename $(SHAREDLIBRARY)).$(APIVERSION).dylib
|
SONAME = $(basename $(SHAREDLIBRARY)).$(APIVERSION).dylib
|
||||||
CFLAGS := -DMACOSX -D_DARWIN_C_SOURCE $(CFLAGS)
|
CFLAGS := -D_DARWIN_C_SOURCE $(CFLAGS)
|
||||||
else
|
else
|
||||||
ifeq ($(JARSUFFIX), win32)
|
ifeq ($(JARSUFFIX), win32)
|
||||||
SHAREDLIBRARY = miniupnpc.dll
|
SHAREDLIBRARY = miniupnpc.dll
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* This software is subjet to the conditions detailed in the
|
* This software is subjet to the conditions detailed in the
|
||||||
* provided LICENSE file. */
|
* provided LICENSE file. */
|
||||||
#define __EXTENSIONS__ 1
|
#define __EXTENSIONS__ 1
|
||||||
#if !defined(MACOSX) && !defined(__sun)
|
#if !defined(__APPLE__) && !defined(__sun)
|
||||||
#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) && !defined(__NetBSD__)
|
#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) && !defined(__NetBSD__)
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
#define _XOPEN_SOURCE 600
|
#define _XOPEN_SOURCE 600
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(MACOSX) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__GNU__) && !defined(__FreeBSD_kernel__)
|
#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__GNU__) && !defined(__FreeBSD_kernel__)
|
||||||
#define HAS_IP_MREQN
|
#define HAS_IP_MREQN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,6 @@ MV = mv
|
||||||
INSTALL = install
|
INSTALL = install
|
||||||
STRIP = strip
|
STRIP = strip
|
||||||
|
|
||||||
CFLAGS += -DMACOSX
|
|
||||||
|
|
||||||
# OSNAME and FWNAME are used for building OS or FW dependent code.
|
# OSNAME and FWNAME are used for building OS or FW dependent code.
|
||||||
OSNAME = $(shell uname)
|
OSNAME = $(shell uname)
|
||||||
ARCH = $(shell uname -p)
|
ARCH = $(shell uname -p)
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
#ifdef __DragonFly__
|
#ifdef __DragonFly__
|
||||||
#include <net/pf/pfvar.h>
|
#include <net/pf/pfvar.h>
|
||||||
#else
|
#else
|
||||||
#ifdef MACOSX
|
#ifdef __APPLE__
|
||||||
#define PRIVATE 1
|
#define PRIVATE 1
|
||||||
#endif
|
#endif
|
||||||
#include <net/pfvar.h>
|
#include <net/pfvar.h>
|
||||||
|
@ -269,7 +269,7 @@ add_redirect_rule2(const char * ifname,
|
||||||
pcr.rule.rdr.addr.type = PF_ADDR_ADDRMASK;
|
pcr.rule.rdr.addr.type = PF_ADDR_ADDRMASK;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MACOSX
|
#ifdef __APPLE__
|
||||||
pcr.rule.dst.xport.range.op = PF_OP_EQ;
|
pcr.rule.dst.xport.range.op = PF_OP_EQ;
|
||||||
pcr.rule.dst.xport.range.port[0] = htons(eport);
|
pcr.rule.dst.xport.range.port[0] = htons(eport);
|
||||||
pcr.rule.dst.xport.range.port[1] = htons(eport);
|
pcr.rule.dst.xport.range.port[1] = htons(eport);
|
||||||
|
@ -528,7 +528,7 @@ get_redirect_rule(const char * ifname, unsigned short eport, int proto,
|
||||||
syslog(LOG_ERR, "ioctl(dev, DIOCGETRULE): %m");
|
syslog(LOG_ERR, "ioctl(dev, DIOCGETRULE): %m");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
#ifdef MACOSX
|
#ifdef __APPLE__
|
||||||
if( (eport == ntohs(pr.rule.dst.xport.range.port[0]))
|
if( (eport == ntohs(pr.rule.dst.xport.range.port[0]))
|
||||||
&& (eport == ntohs(pr.rule.dst.xport.range.port[1]))
|
&& (eport == ntohs(pr.rule.dst.xport.range.port[1]))
|
||||||
#else
|
#else
|
||||||
|
@ -636,7 +636,7 @@ priv_delete_redirect_rule(const char * ifname, unsigned short eport,
|
||||||
syslog(LOG_ERR, "ioctl(dev, DIOCGETRULE): %m");
|
syslog(LOG_ERR, "ioctl(dev, DIOCGETRULE): %m");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
#ifdef MACOSX
|
#ifdef __APPLE__
|
||||||
if( (eport == ntohs(pr.rule.dst.xport.range.port[0]))
|
if( (eport == ntohs(pr.rule.dst.xport.range.port[0]))
|
||||||
&& (eport == ntohs(pr.rule.dst.xport.range.port[1]))
|
&& (eport == ntohs(pr.rule.dst.xport.range.port[1]))
|
||||||
#else
|
#else
|
||||||
|
@ -830,7 +830,7 @@ get_redirect_rule_by_index(int index,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
*proto = pr.rule.proto;
|
*proto = pr.rule.proto;
|
||||||
#ifdef MACOSX
|
#ifdef __APPLE__
|
||||||
*eport = ntohs(pr.rule.dst.xport.range.port[0]);
|
*eport = ntohs(pr.rule.dst.xport.range.port[0]);
|
||||||
#else
|
#else
|
||||||
*eport = ntohs(pr.rule.dst.port[0]);
|
*eport = ntohs(pr.rule.dst.port[0]);
|
||||||
|
@ -946,7 +946,7 @@ get_portmappings_in_range(unsigned short startport, unsigned short endport,
|
||||||
syslog(LOG_ERR, "ioctl(dev, DIOCGETRULE): %m");
|
syslog(LOG_ERR, "ioctl(dev, DIOCGETRULE): %m");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#ifdef MACOSX
|
#ifdef __APPLE__
|
||||||
eport = ntohs(pr.rule.dst.xport.range.port[0]);
|
eport = ntohs(pr.rule.dst.xport.range.port[0]);
|
||||||
if( (eport == ntohs(pr.rule.dst.xport.range.port[1]))
|
if( (eport == ntohs(pr.rule.dst.xport.range.port[1]))
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#ifdef __DragonFly__
|
#ifdef __DragonFly__
|
||||||
#include <net/pf/pfvar.h>
|
#include <net/pf/pfvar.h>
|
||||||
#else
|
#else
|
||||||
#ifdef MACOSX
|
#ifdef __APPLE__
|
||||||
#define PRIVATE 1
|
#define PRIVATE 1
|
||||||
#endif
|
#endif
|
||||||
#include <net/pfvar.h>
|
#include <net/pfvar.h>
|
||||||
|
|
Loading…
Reference in New Issue