mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
miniupnpc: Update to version 2.2.3
Library code and public headers are now properly separated, we can fix include paths to remove the redundant subfolder.
This commit is contained in:
3
thirdparty/miniupnpc/LICENSE
vendored
3
thirdparty/miniupnpc/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
MiniUPnPc
|
||||
MiniUPnP Project
|
||||
Copyright (c) 2005-2020, Thomas BERNARD
|
||||
All rights reserved.
|
||||
|
||||
@@ -24,4 +24,3 @@ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: miniupnpc.h,v 1.58 2021/03/02 23:49:52 nanard Exp $ */
|
||||
/* $Id: miniupnpc.h,v 1.59 2021/09/28 21:39:17 nanard Exp $ */
|
||||
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
||||
* Project: miniupnp
|
||||
* http://miniupnp.free.fr/
|
||||
@@ -20,7 +20,7 @@
|
||||
#define UPNPDISCOVER_MEMORY_ERROR (-102)
|
||||
|
||||
/* versions : */
|
||||
#define MINIUPNPC_VERSION "2.2.2"
|
||||
#define MINIUPNPC_VERSION "2.2.3"
|
||||
#define MINIUPNPC_API_VERSION 17
|
||||
|
||||
/* Source port:
|
||||
@@ -1,13 +1,15 @@
|
||||
/* $Id: miniupnpctypes.h,v 1.1 2011/02/15 11:10:40 nanard Exp $ */
|
||||
/* Miniupnp project : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org
|
||||
* Author : Thomas Bernard
|
||||
* Copyright (c) 2011 Thomas Bernard
|
||||
* Copyright (c) 2021 Thomas Bernard
|
||||
* This software is subject to the conditions detailed in the
|
||||
* LICENCE file provided within this distribution */
|
||||
#ifndef MINIUPNPCTYPES_H_INCLUDED
|
||||
#define MINIUPNPCTYPES_H_INCLUDED
|
||||
|
||||
#if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
|
||||
/* Use unsigned long long when available :
|
||||
* strtoull is C99 */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#define UNSIGNED_INTEGER unsigned long long
|
||||
#define STRTOUI strtoull
|
||||
#else
|
||||
@@ -1,8 +1,8 @@
|
||||
/* $Id: upnpdev.h,v 1.3 2020/05/29 15:57:42 nanard Exp $ */
|
||||
/* $Id: upnpdev.h,v 1.4 2021/08/21 09:45:01 nanard Exp $ */
|
||||
/* Project : miniupnp
|
||||
* Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
||||
* Author : Thomas BERNARD
|
||||
* copyright (c) 2005-2020 Thomas Bernard
|
||||
* copyright (c) 2005-2021 Thomas Bernard
|
||||
* This software is subjet to the conditions detailed in the
|
||||
* provided LICENSE file. */
|
||||
#ifndef UPNPDEV_H_INCLUDED
|
||||
@@ -20,7 +20,7 @@ struct UPNPDev {
|
||||
char * st;
|
||||
char * usn;
|
||||
unsigned int scope_id;
|
||||
#if defined(__STDC_VERSION) && __STDC_VERSION__ >= 199901L
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
/* C99 flexible array member */
|
||||
char buffer[];
|
||||
#elif defined(__GNUC__)
|
||||
@@ -56,7 +56,7 @@ int addr_is_reserved(const char * addr_str)
|
||||
uint32_t addr_n, address;
|
||||
size_t i;
|
||||
|
||||
#if defined(_WIN32) && (!defined(_WIN32_WINNT_VISTA) || (_WIN32_WINNT < _WIN32_WINNT_VISTA))
|
||||
#if defined(_WIN32) && _WIN32_WINNT < 0x0600 // _WIN32_WINNT_VISTA
|
||||
addr_n = inet_addr(addr_str);
|
||||
if (addr_n == INADDR_NONE)
|
||||
return 1;
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: minissdpc.c,v 1.47 2021/03/02 23:38:30 nanard Exp $ */
|
||||
/* $Id: minissdpc.c,v 1.49 2021/05/13 11:00:36 nanard Exp $ */
|
||||
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
||||
* Project : miniupnp
|
||||
* Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
||||
@@ -460,7 +460,7 @@ parseMSEARCHReply(const char * reply, int size,
|
||||
static int upnp_gettimeofday(struct timeval * tv)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
#if defined(_WIN32_WINNT_VISTA) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
|
||||
#if _WIN32_WINNT >= 0x0600 // _WIN32_WINNT_VISTA
|
||||
ULONGLONG ts = GetTickCount64();
|
||||
#else
|
||||
DWORD ts = GetTickCount();
|
||||
@@ -469,14 +469,29 @@ static int upnp_gettimeofday(struct timeval * tv)
|
||||
tv->tv_usec = (ts % 1000) * 1000;
|
||||
return 0; /* success */
|
||||
#elif defined(CLOCK_MONOTONIC_FAST) || defined(CLOCK_MONOTONIC)
|
||||
struct timespec ts;
|
||||
int ret_code = clock_gettime(UPNP_CLOCKID, &ts);
|
||||
if (ret_code == 0)
|
||||
{
|
||||
tv->tv_sec = ts.tv_sec;
|
||||
tv->tv_usec = ts.tv_nsec / 1000;
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
if (__builtin_available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)) {
|
||||
#else /* !defined(__clang__) */
|
||||
if (clock_gettime != NULL) {
|
||||
#endif /* defined(__clang__) */
|
||||
#endif /* defined(__APPLE__) */
|
||||
struct timespec ts;
|
||||
int ret_code = clock_gettime(UPNP_CLOCKID, &ts);
|
||||
if (ret_code == 0)
|
||||
{
|
||||
tv->tv_sec = ts.tv_sec;
|
||||
tv->tv_usec = ts.tv_nsec / 1000;
|
||||
}
|
||||
return ret_code;
|
||||
#if defined(__APPLE__)
|
||||
}
|
||||
return ret_code;
|
||||
else
|
||||
{
|
||||
/* fall-back for earlier Apple platforms */
|
||||
return gettimeofday(tv, NULL);
|
||||
}
|
||||
#endif /* defined(__APPLE__) */
|
||||
#else
|
||||
return gettimeofday(tv, NULL);
|
||||
#endif
|
||||
@@ -705,7 +720,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
|
||||
}
|
||||
}
|
||||
|
||||
if(multicastif)
|
||||
if(multicastif && multicastif[0] != '\0')
|
||||
{
|
||||
if(ipv6) {
|
||||
#if !defined(_WIN32)
|
||||
@@ -732,7 +747,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
|
||||
} else {
|
||||
struct in_addr mc_if;
|
||||
#if defined(_WIN32)
|
||||
#if defined(_WIN32_WINNT_VISTA) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
|
||||
#if _WIN32_WINNT >= 0x0600 // _WIN32_WINNT_VISTA
|
||||
InetPtonA(AF_INET, multicastif, &mc_if);
|
||||
#else
|
||||
mc_if.s_addr = inet_addr(multicastif); /* old Windows SDK do not support InetPtoA() */
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "core/version.h"
|
||||
|
||||
#define OS_STRING VERSION_NAME "/1.0"
|
||||
#define MINIUPNPC_VERSION_STRING "2.2.2"
|
||||
#define MINIUPNPC_VERSION_STRING "2.2.3"
|
||||
|
||||
#if 0
|
||||
/* according to "UPnP Device Architecture 1.0" */
|
||||
Reference in New Issue
Block a user