djgpp: Define WATT32_NO_OLDIES before including socket headers
authorJ.W. Jagersma <jwjagersma@gmail.com>
Sun, 25 Sep 2022 17:13:32 +0000 (19:13 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 29 Sep 2022 10:04:01 +0000 (12:04 +0200)
If this macro is left undefined, Watt-32 will "helpfully" declare some
typedefs such as 'byte' and 'word' in the global namespace.  This broke
compilation of apps/s_client.c.

CLA: trivial

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19274)

(cherry picked from commit 8ae74c5bc091e7388c082f090c1fde992c31320f)

include/internal/sockets.h

index 4701eb7e0e483af1685e4871d8b9653aa6673281..1876af8fafec31b54e76fd925563f7c8e8b84f49 100644 (file)
@@ -28,6 +28,8 @@
 
 # elif defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
 #  if defined(__DJGPP__)
+#   define WATT32
+#   define WATT32_NO_OLDIES
 #   include <sys/socket.h>
 #   include <sys/un.h>
 #   include <tcp.h>
@@ -134,8 +136,6 @@ struct servent *PASCAL getservbyname(const char *, const char *);
 #  define readsocket(s,b,n)       recv((s),(b),(n),0)
 #  define writesocket(s,b,n)      send((s),(b),(n),0)
 # elif defined(__DJGPP__)
-#  define WATT32
-#  define WATT32_NO_OLDIES
 #  define closesocket(s)          close_s(s)
 #  define readsocket(s,b,n)       read_s(s,b,n)
 #  define writesocket(s,b,n)      send(s,b,n,0)