changeset 2873:0bbfb19022e7

C++: GCC prior to 4.7 does not support the override keyword. So if using earlier versions of GCC, just remove override. This allows compilation on ancient GCC and GCC based Xcode. Also remove virtual from the application, I don't think it is needed and old GCC pukes on it when it is there.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 19 Dec 2022 07:42:12 +0000
parents e62fc9b3b09c
children 585d0053b766
files dw.hpp dwtestoo.cpp
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dw.hpp	Mon Dec 19 00:07:06 2022 +0000
+++ b/dw.hpp	Mon Dec 19 07:42:12 2022 +0000
@@ -14,6 +14,11 @@
 #define DW_NULL NULL
 #endif
 
+// Attempt to allow compilation on GCC older than 4.7
+#if defined(__GNUC__) && (__GNuC__ < 5 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7))
+#define override
+#endif	
+
 namespace DW 
 {
 
--- a/dwtestoo.cpp	Mon Dec 19 00:07:06 2022 +0000
+++ b/dwtestoo.cpp	Mon Dec 19 07:42:12 2022 +0000
@@ -10,8 +10,8 @@
         SetText("Basic application");
         SetSize(200, 200);
      }
-     virtual int OnDelete() override { DW::App *app = DW::App::Init(); app->MainQuit(); return FALSE; }
-     virtual int OnConfigure(int width, int height) override { return FALSE; }
+     int OnDelete() override { DW::App *app = DW::App::Init(); app->MainQuit(); return FALSE; }
+     int OnConfigure(int width, int height) override { return FALSE; }
 };
 
 int dwmain(int argc, char* argv[])