summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2025-03-06 19:17:18 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2025-03-06 19:23:25 +0100
commit27101536f6a75294ebaa196d82c3ef13eb0a705a (patch)
tree0e4a022049ed83f8ee4d5a6c28c4a1de7b503b7f
parentdc07f927f1ae97dff76741025856c342794a9662 (diff)
Define FL_OVERRIDE unconditionally as 'override'
FLTK 1.5 requires at least C++11, hence we can always use 'override'. To do: the FL_OVERRIDE macro can be replaced by 'override' everywhere in the FLTK code. There are more than 2400 occurrences and this would be a large commit. Therefore it's not done right now... Note: user code may continue to use FL_OVERRIDE.
-rw-r--r--FL/fl_attr.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/FL/fl_attr.h b/FL/fl_attr.h
index 73884ffe3..ef9587997 100644
--- a/FL/fl_attr.h
+++ b/FL/fl_attr.h
@@ -1,7 +1,7 @@
/*
* Function attribute declarations for the Fast Light Tool Kit (FLTK).
*
- * Copyright 1998-2024 by Bill Spitzak and others.
+ * Copyright 1998-2025 by Bill Spitzak and others.
*
* This library is free software. Distribution and use rights are outlined in
* the file "COPYING" which should have been included with this file. If this
@@ -24,6 +24,21 @@
/**
+ This macro makes it safe to use the C++11 keyword \c override with
+ older compilers.
+
+ Since FLTK 1.5.0 a C++11 capable compiler is required, hence we can safely
+ define FL_OVERRIDE unconditionally as 'override'.
+
+ This macro is kept for backwards compatibility with old (1.4.x) user code
+ that uses the FL_OVERRIDE macro.
+
+ We recommend to use 'override' explicitly if C++11 or higher is available.
+*/
+#define FL_OVERRIDE override
+
+
+/**
This section lists macros for Doxygen documentation only. The next section
will define the actual macros based on the compile used and based on the
capabilities of the version of that compiler.
@@ -39,11 +54,6 @@
*/
#define __fl_attr(x)
-/**
- This macro makes it safe to use the C++11 keyword \c override with
- older compilers.
-*/
-#define FL_OVERRIDE override
/**
Enclosing a function or method in FL_DEPRECATED marks it as no longer
@@ -100,9 +110,6 @@
#if defined(_MSC_VER)
#if (_MSC_VER >= 1900) // Visual Studio 2015 (14.0)
-#ifndef FL_OVERRIDE
-#define FL_OVERRIDE override
-#endif
#endif // Visual Studio 2015 (14.0)
#if (_MSC_VER >= 1400) // Visual Studio 2005 (8.0)
@@ -138,9 +145,6 @@
#endif // C++14
#if (__cplusplus >= 201103L) // C++11
-#ifndef FL_OVERRIDE
-#define FL_OVERRIDE override
-#endif
#endif // C+11
#if (__cplusplus >= 199711L) // C++89
@@ -198,10 +202,6 @@
#define __fl_attr(x)
#endif
-#ifndef FL_OVERRIDE
-#define FL_OVERRIDE
-#endif
-
#ifndef FL_DEPRECATED
#define FL_DEPRECATED(msg, func) func
#endif