]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove check for anonymous unions from configure and cmake config
authorArne Schwabe <arne@rfc2549.org>
Wed, 10 Jul 2024 16:02:38 +0000 (18:02 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 12 Sep 2024 14:59:43 +0000 (16:59 +0200)
Anonymous unions/structs are technically a custom GNU C99 feature but
was already widely supported by other compilers. With C11 this feature
has become a standard feature so all compilers nowadays support it.

Change-Id: I1ef5f6f21f0135a628a63553c39515fa4549ce87
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20240710160238.190189-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28914.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
config.h.cmake.in
configure.ac
src/openvpn/mroute.h

index 720d679c8671a84cf1ff5db19a31e8c8f9c4979c..18af5e9f4a081d79265d2273c1d78320e864d4ce 100644 (file)
@@ -65,9 +65,6 @@
 /* Enable --x509-username-field feature */
 #cmakedefine ENABLE_X509ALTUSERNAME
 
-/* Compiler supports anonymous unions */
-#define HAVE_ANONYMOUS_UNION_SUPPORT
-
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #cmakedefine HAVE_ARPA_INET_H 1
 
index 9e569bfcac3db754a4418cbea5f3d3605df7dc28..9bc15c854de3eef7ddffb80f27b757f450af12c8 100644 (file)
@@ -564,28 +564,6 @@ AC_CHECK_DECLS(
        ,
        [[${SOCKET_INCLUDES}]]
 )
-AC_MSG_CHECKING([anonymous union support])
-AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-               [[
-                       struct mystruct {
-                         union {
-                           int m1;
-                           char m2;
-                         };
-                       };
-               ]],
-               [[
-                       struct mystruct s;
-                       s.m1 = 1; s.m2 = 2;
-               ]]
-       )],
-       [
-               AC_MSG_RESULT([yes])
-               AC_DEFINE([HAVE_ANONYMOUS_UNION_SUPPORT], [], [Compiler supports anonymous unions])
-       ],
-       [AC_MSG_RESULT([no])]
-)
 
 saved_LDFLAGS="$LDFLAGS"
 LDFLAGS="$LDFLAGS -Wl,--wrap=exit"
index bc58493393ebc7a1df8f66fe98c555759100abca..8b457d4e029fbedda5d8f8259b5db4500c910a10 100644 (file)
@@ -96,17 +96,7 @@ struct mroute_addr {
             uint8_t prefix[12];
             in_addr_t addr;     /* _network order_ IPv4 address */
         } v4mappedv6;
-    }
-#ifndef HAVE_ANONYMOUS_UNION_SUPPORT
-/* Wrappers to support compilers that do not grok anonymous unions */
-        mroute_union
-#define raw_addr mroute_union.raw_addr
-#define ether mroute_union.ether
-#define v4 mroute_union.v4
-#define v6 mroute_union.v6
-#define v4mappedv6 mroute_union.v4mappedv6
-#endif
-    ;
+    };
 };
 
 /* Double-check that struct packing works as expected */