From 685d128c0fe444d112796b5e03a98d470e3c321a Mon Sep 17 00:00:00 2001 From: SuperIlu Date: Sun, 1 Dec 2024 10:05:21 +0100 Subject: [PATCH 1/3] Make mbedTLS compile with MS-DOS DJGPP Signed-off-by: SuperIlu --- library/net_sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/net_sockets.c b/library/net_sockets.c index f752d13d3c..ca70f3797b 100644 --- a/library/net_sockets.c +++ b/library/net_sockets.c @@ -524,8 +524,8 @@ void mbedtls_net_usleep(unsigned long usec) #else struct timeval tv; tv.tv_sec = usec / 1000000; -#if defined(__unix__) || defined(__unix) || \ - (defined(__APPLE__) && defined(__MACH__)) +#if (defined(__unix__) || defined(__unix) || \ + (defined(__APPLE__) && defined(__MACH__))) && !defined(__DJGPP__) tv.tv_usec = (suseconds_t) usec % 1000000; #else tv.tv_usec = usec % 1000000; From 1406ace4d2e6a8fc7180dc080c431077fdc6e7cf Mon Sep 17 00:00:00 2001 From: SuperIlu Date: Sun, 1 Dec 2024 10:16:36 +0100 Subject: [PATCH 2/3] Added changelog Signed-off-by: SuperIlu --- ChangeLog.d/fix-compilation-with-djgpp.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ChangeLog.d/fix-compilation-with-djgpp.txt diff --git a/ChangeLog.d/fix-compilation-with-djgpp.txt b/ChangeLog.d/fix-compilation-with-djgpp.txt new file mode 100644 index 0000000000..45c565957e --- /dev/null +++ b/ChangeLog.d/fix-compilation-with-djgpp.txt @@ -0,0 +1,5 @@ +Bugfix: + * DJGPP does not provide `suseconds_t`, but defines `__unix__` + * `net_sockets.c` uses it for `mbedtls_net_usleep()` + * This fix makes use of the alternate codepath w/o `suseconds_t` if `__DJGPP__` is defined + From cda2a28c9231006940a5a4cde980b065ade6e634 Mon Sep 17 00:00:00 2001 From: SuperIlu Date: Mon, 2 Dec 2024 21:24:00 +0100 Subject: [PATCH 3/3] reworked changelog according to suggestion Signed-off-by: SuperIlu --- ChangeLog.d/fix-compilation-with-djgpp.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ChangeLog.d/fix-compilation-with-djgpp.txt b/ChangeLog.d/fix-compilation-with-djgpp.txt index 45c565957e..5b79fb69de 100644 --- a/ChangeLog.d/fix-compilation-with-djgpp.txt +++ b/ChangeLog.d/fix-compilation-with-djgpp.txt @@ -1,5 +1,2 @@ -Bugfix: - * DJGPP does not provide `suseconds_t`, but defines `__unix__` - * `net_sockets.c` uses it for `mbedtls_net_usleep()` - * This fix makes use of the alternate codepath w/o `suseconds_t` if `__DJGPP__` is defined - +Bugfix + * Fix compilation on MS-DOS DJGPP. Fixes #9813.