diff --git a/ChangeLog.d/fix-compilation-with-djgpp.txt b/ChangeLog.d/fix-compilation-with-djgpp.txt new file mode 100644 index 0000000000..5b79fb69de --- /dev/null +++ b/ChangeLog.d/fix-compilation-with-djgpp.txt @@ -0,0 +1,2 @@ +Bugfix + * Fix compilation on MS-DOS DJGPP. Fixes #9813. 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;