From 7e6d4c13a8ff19e4733ad7d8a43549a4481f174c 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 bd5c47b4b7..1419c787b9 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 95355befd5a5991979e74fadbe2d4fabdb26eb82 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 f36f405c05f5dfaf3ffa0569c6cf39252c8d0a45 Mon Sep 17 00:00:00 2001 From: SuperIlu Date: Mon, 2 Dec 2024 21:25:11 +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.