From e5afb8a5328f2770028ac03f9100604ba69b62cb Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 11 May 2024 17:14:28 +0200 Subject: Enable suppression of "deprecated" warnings (FL_NO_DEPRECATE) This is intended for backwards compatibility with FLTK 1.3.x code ported to 1.4.0. Users defining FL_NO_DEPRECATE can compile old (1.3.x) code w/o seeing lots of "deprecated" warnings. A legitimate use case is if old (1.3) code is intended to be used with both FLTK 1.3 and 1.4. FL_NO_DEPRECATE should NOT be defined if the user's code is targeted at 1.4.x or later. Users should fix their code to be prepared for the next minor release (e.g. 1.5.0). Todo: document this. --- FL/fl_attr.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/FL/fl_attr.h b/FL/fl_attr.h index 46d4cb793..73884ffe3 100644 --- a/FL/fl_attr.h +++ b/FL/fl_attr.h @@ -61,6 +61,19 @@ #else /* FL_DOXYGEN */ +// If FL_NO_DEPRECATED is defined FLTK 1.4 can compile 1.3.x code without +// issuing several "deprecated" warnings (1.3 "compatibility" mode). +// FL_DEPRECATED will be defined as a no-op. + +// If FL_NO_DEPRECATED is not defined (default) FLTK 1.4 will issue several +// "deprecated" warnings depending on the compiler in use: FL_DEPRECATED +// will be defined according to the capabilities of the compiler (below). +// The definition below this comment must match the one at the end of this file. + +#if defined(FL_NO_DEPRECATED) +#define FL_DEPRECATED(msg, func) func +#endif + #ifdef __cplusplus /* -- cgit v1.2.3