lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6455] Forestall gcc-4.9.2 internal attribute warnings


From: Greg Chicares
Subject: [lmi-commits] [6455] Forestall gcc-4.9.2 internal attribute warnings
Date: Mon, 21 Dec 2015 01:59:38 +0000

Revision: 6455
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6455
Author:   chicares
Date:     2015-12-21 01:59:37 +0000 (Mon, 21 Dec 2015)
Log Message:
-----------
Forestall gcc-4.9.2 internal attribute warnings

Modified Paths:
--------------
    lmi/trunk/database_document.hpp
    lmi/trunk/so_attributes.hpp
    lmi/trunk/wx_utility.hpp

Modified: lmi/trunk/database_document.hpp
===================================================================
--- lmi/trunk/database_document.hpp     2015-12-21 01:38:12 UTC (rev 6454)
+++ lmi/trunk/database_document.hpp     2015-12-21 01:59:37 UTC (rev 6455)
@@ -34,7 +34,7 @@
 #include <map>
 #include <string>
 
-class LMI_SO database_entity;
+class LMI_SO_FWD_DECL database_entity;
 
 class DatabaseDocument
     :public ProductEditorDocument

Modified: lmi/trunk/so_attributes.hpp
===================================================================
--- lmi/trunk/so_attributes.hpp 2015-12-21 01:38:12 UTC (rev 6454)
+++ lmi/trunk/so_attributes.hpp 2015-12-21 01:59:37 UTC (rev 6455)
@@ -97,5 +97,30 @@
 #   define LMI_SO
 #endif // !defined LMI_USE_SO_ATTRIBUTES
 
+// Forward declaration macro.
+//
+// In general,
+//   class ATTRIB foo {}
+// can be forward declared thus:
+//   class ATTRIB foo;
+// That worked for MinGW up to gcc-3.4.5; for MinGW-w64 gcc-4.9.2, 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.
+
+#if defined LMI_USE_SO_ATTRIBUTES
+#   if defined __GNUC__
+#       if LMI_GCC_VERSION < 40902
+#           define LMI_SO_FWD_DECL LMI_SO
+#       else  // !(LMI_GCC_VERSION < 40902)
+#           define LMI_SO_FWD_DECL
+#       endif // !(LMI_GCC_VERSION < 40902)
+#   else  // !defined __GNUC__
+#       define LMI_SO_FWD_DECL LMI_SO
+#   endif // !defined __GNUC__
+#else  // !defined LMI_USE_SO_ATTRIBUTES
+#   define LMI_SO_FWD_DECL
+#endif // !defined LMI_USE_SO_ATTRIBUTES
+
 #endif // so_attributes_hpp
 

Modified: lmi/trunk/wx_utility.hpp
===================================================================
--- lmi/trunk/wx_utility.hpp    2015-12-21 01:38:12 UTC (rev 6454)
+++ lmi/trunk/wx_utility.hpp    2015-12-21 01:59:37 UTC (rev 6455)
@@ -41,7 +41,7 @@
 #include <string>
 #include <vector>
 
-class LMI_SO calendar_date;
+class LMI_SO_FWD_DECL calendar_date;
 class WXDLLIMPEXP_FWD_CORE wxApp;
 class WXDLLIMPEXP_FWD_CORE wxBookCtrlBase;
 class WXDLLIMPEXP_FWD_CORE wxDateTime;




reply via email to

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