lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 6f90cde: Generally don't decorate forward dec


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6f90cde: Generally don't decorate forward declarations with attributes
Date: Mon, 19 Oct 2020 20:18:53 -0400 (EDT)

branch: master
commit 6f90cde247a53092df914407161f657a214ca9bc
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Generally don't decorate forward declarations with attributes
---
 so_attributes.hpp | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/so_attributes.hpp b/so_attributes.hpp
index d35b05d..50df5d4 100644
--- a/so_attributes.hpp
+++ b/so_attributes.hpp
@@ -108,27 +108,27 @@
 
 // Forward declaration macro.
 //
-// In general,
+// If a class defined with an attribute chosen by a macro:
 //   class ATTRIB foo {}
-// can be forward declared thus:
+// is to be forward declared, should the forward declaration specify
+// the attribute macro, or not? For some ancient msw compilers, this:
 //   class ATTRIB foo;
-// That worked for MinGW up to gcc-3.4.5; for MinGW-w64 gcc-4.9.1, it
-// elicits a warning, and ATTRIB must be dropped from the forward
-// declaration. No knowledge is claimed of the behavior of gcc
-// versions between these two, which lmi did not use. It is unknown
-// whether this difference represents deliberate evolution of gcc or
-// a MinGW-w64 regression, so both versions are preserved.
+// was apparently required, and it was accepted by mingw.org gcc up
+// to version 3.4.5 at least. However, for MinGW-w64 gcc since at
+// least version 4.9.1, it elicits a warning, and ATTRIB must be
+// dropped from the forward declaration, thus:
+//   class foo;
+// Here, the latter form is used by default, and the former form is
+// preserved in case it's ever needed again (below, with a jocular
+// conditional evoking ancient tools). See:
+//   https://lists.nongnu.org/archive/html/lmi/2020-10/msg00097.html
 
 #if defined LMI_USE_SO_ATTRIBUTES
-#   if defined __GNUC__
-#       if defined LMI_MINGW_W64
-#           define LMI_SO_FWD_DECL
-#       else  // !defined LMI_MINGW_W64
-#           define LMI_SO_FWD_DECL
-#       endif // !defined LMI_MINGW_W64
-#   else  // !defined __GNUC__
+#   if defined __BORLANDC__
 #       define LMI_SO_FWD_DECL LMI_SO
-#   endif // !defined __GNUC__
+#   else  // !defined __BORLANDC__
+#       define LMI_SO_FWD_DECL
+#   endif // !defined __BORLANDC__
 #else  // !defined LMI_USE_SO_ATTRIBUTES
 #   define LMI_SO_FWD_DECL
 #endif // !defined LMI_USE_SO_ATTRIBUTES



reply via email to

[Prev in Thread] Current Thread [Next in Thread]