mirror of
https://github.com/status-im/miniupnp.git
synced 2025-01-14 16:34:37 +00:00
miniupnpc: fix Win32 build, both MinGW and MSVC
This commit is contained in:
parent
3a6e41f516
commit
6092fdb4f8
@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile.mingw,v 1.18 2014/01/17 09:04:01 nanard Exp $
|
# $Id: Makefile.mingw,v 1.21 2015/09/18 12:45:16 nanard Exp $
|
||||||
# Miniupnp project.
|
# Miniupnp project.
|
||||||
# http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
# http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||||
# (c) 2005-2015 Thomas Bernard
|
# (c) 2005-2015 Thomas Bernard
|
||||||
@ -92,7 +92,7 @@ upnpreplyparse.o: upnpreplyparse.c upnpreplyparse.h minixml.h
|
|||||||
|
|
||||||
upnpcommands.o: upnpcommands.c upnpcommands.h upnpreplyparse.h miniupnpc.h portlistingparse.h
|
upnpcommands.o: upnpcommands.c upnpcommands.h upnpreplyparse.h miniupnpc.h portlistingparse.h
|
||||||
|
|
||||||
minissdpc.o: minissdpc.c minissdpc.h codelength.h receivedata.h
|
minissdpc.o: minissdpc.c minissdpc.h receivedata.h
|
||||||
|
|
||||||
upnpdev.o: upnpdev.c upnpdev.h
|
upnpdev.o: upnpdev.c upnpdev.h
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: minissdpc.c,v 1.15 2012/01/21 13:30:31 nanard Exp $ */
|
/* $Id: minissdpc.c,v 1.28 2015/09/18 13:05:39 nanard Exp $ */
|
||||||
/* Project : miniupnp
|
/* Project : miniupnp
|
||||||
* Web : http://miniupnp.free.fr/
|
* Web : http://miniupnp.free.fr/
|
||||||
* Author : Thomas BERNARD
|
* Author : Thomas BERNARD
|
||||||
@ -8,9 +8,7 @@
|
|||||||
/*#include <syslog.h>*/
|
/*#include <syslog.h>*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__)
|
#if defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -19,7 +17,12 @@
|
|||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
|
#define snprintf _snprintf
|
||||||
|
#if !defined(_MSC_VER)
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#else /* !defined(_MSC_VER) */
|
||||||
|
typedef unsigned short uint16_t;
|
||||||
|
#endif /* !defined(_MSC_VER) */
|
||||||
#ifndef strncasecmp
|
#ifndef strncasecmp
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||||
#define strncasecmp _memicmp
|
#define strncasecmp _memicmp
|
||||||
@ -41,6 +44,8 @@ struct sockaddr_un {
|
|||||||
char sun_path[UNIX_PATH_LEN];
|
char sun_path[UNIX_PATH_LEN];
|
||||||
};
|
};
|
||||||
#else /* defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__) */
|
#else /* defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__) */
|
||||||
|
#include <strings.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@ -79,9 +84,11 @@ struct ip_mreqn
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "minissdpc.h"
|
#include "minissdpc.h"
|
||||||
|
#include "receivedata.h"
|
||||||
|
|
||||||
|
#if !(defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__))
|
||||||
|
|
||||||
#include "codelength.h"
|
#include "codelength.h"
|
||||||
#include "receivedata.h"
|
|
||||||
|
|
||||||
struct UPNPDev *
|
struct UPNPDev *
|
||||||
getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath, int * error)
|
getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath, int * error)
|
||||||
@ -359,6 +366,8 @@ free_tmp_and_return:
|
|||||||
return devlist;
|
return devlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* !(defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__)) */
|
||||||
|
|
||||||
/* parseMSEARCHReply()
|
/* parseMSEARCHReply()
|
||||||
* the last 4 arguments are filled during the parsing :
|
* the last 4 arguments are filled during the parsing :
|
||||||
* - location/locationsize : "location:" field of the SSDP reply packet
|
* - location/locationsize : "location:" field of the SSDP reply packet
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: minissdpc.h,v 1.4 2015/07/23 20:40:08 nanard Exp $ */
|
/* $Id: minissdpc.h,v 1.6 2015/09/18 12:45:16 nanard Exp $ */
|
||||||
/* Project: miniupnp
|
/* Project: miniupnp
|
||||||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||||
* Author: Thomas Bernard
|
* Author: Thomas Bernard
|
||||||
@ -23,6 +23,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !(defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__))
|
||||||
|
|
||||||
MINIUPNP_LIBSPEC struct UPNPDev *
|
MINIUPNP_LIBSPEC struct UPNPDev *
|
||||||
getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath, int * error);
|
getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath, int * error);
|
||||||
|
|
||||||
@ -38,6 +40,8 @@ requestDevicesFromMiniSSDPD(int fd, const char * devtype);
|
|||||||
MINIUPNP_LIBSPEC struct UPNPDev *
|
MINIUPNP_LIBSPEC struct UPNPDev *
|
||||||
receiveDevicesFromMiniSSDPD(int fd, int * error);
|
receiveDevicesFromMiniSSDPD(int fd, int * error);
|
||||||
|
|
||||||
|
#endif /* !(defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__)) */
|
||||||
|
|
||||||
MINIUPNP_LIBSPEC struct UPNPDev *
|
MINIUPNP_LIBSPEC struct UPNPDev *
|
||||||
ssdpDiscoverDevices(const char * const deviceTypes[],
|
ssdpDiscoverDevices(const char * const deviceTypes[],
|
||||||
int delay, const char * multicastif,
|
int delay, const char * multicastif,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user