mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-22 23:25:30 +00:00
Merge pull request #3558 from gufe44/net-sockets-fixes-2.16
[Backport 2.16] NetBSD 9.0 build fixes
This commit is contained in:
commit
b9c64e4538
5
ChangeLog.d/fix-build-netbsd.txt
Normal file
5
ChangeLog.d/fix-build-netbsd.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
Bugfix
|
||||
* Fix building library/net_sockets.c and the ssl_mail_client program on
|
||||
NetBSD. NetBSD conditionals were added for the backport to avoid the risk
|
||||
of breaking a platform. Original fix contributed by Nia Alarie in #3422.
|
||||
Adapted for long-term support branch 2.16 in #3558.
|
|
@ -51,6 +51,10 @@
|
|||
* Harmless on other platforms. */
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
#define _XOPEN_SOURCE 600 /* sockaddr_storage */
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_CONFIG_FILE)
|
||||
#include "mbedtls/config.h"
|
||||
#else
|
||||
|
@ -345,8 +349,9 @@ int mbedtls_net_accept( mbedtls_net_context *bind_ctx,
|
|||
|
||||
struct sockaddr_storage client_addr;
|
||||
|
||||
#if defined(__socklen_t_defined) || defined(_SOCKLEN_T) || \
|
||||
defined(_SOCKLEN_T_DECLARED) || defined(__DEFINED_socklen_t)
|
||||
#if defined(__socklen_t_defined) || defined(_SOCKLEN_T) || \
|
||||
defined(_SOCKLEN_T_DECLARED) || defined(__DEFINED_socklen_t) || \
|
||||
( defined(__NetBSD__) && defined(socklen_t) )
|
||||
socklen_t n = (socklen_t) sizeof( client_addr );
|
||||
socklen_t type_len = (socklen_t) sizeof( type );
|
||||
#else
|
||||
|
|
|
@ -51,6 +51,10 @@
|
|||
* Harmless on other platforms. */
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
#define _XOPEN_SOURCE 600
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_CONFIG_FILE)
|
||||
#include "mbedtls/config.h"
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue