diff libinterp/corefcn/error.h @ 29954:4c88a452519c

rename OCTAVE_USE_DEPRECATED_FUNCTIONS macro and attempt to make it work For ordinary functions declared in a header file and defined in a corresponding source file, it should be OK to omit the declaration in the header file based on the value of OCTAVE_PROVIDE_DEPRECATED_SYMBOLS. But it is an error to attempt to define a member function that has not been declared in the class declaration. So for these, we rename the original function to be FOO_deprecated and then provide a wrapper function called FOO that is completely defined in the header file and simply calls the FOO_deprecated function. * mk-octave-config-h.sh, oct-conf-post.in.h (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS): Rename from OCTAVE_USE_DEPRECATED_FUNCTIONS. Change all uses. For deprecated member fucntions, use private FOO_deprecated member functions and conditionally defined inline public wrappers to allow declarations of deprecated symbosl to be omitted if OCTAVE_PROVIDE_DEPRECATED_SYMBOLS is not defined.
author John W. Eaton <jwe@octave.org>
date Sat, 14 Aug 2021 11:13:17 -0400
parents 220c6c4a3533
children a956ca6698d2
line wrap: on
line diff
--- a/libinterp/corefcn/error.h	Sat Aug 14 10:40:21 2021 -0400
+++ b/libinterp/corefcn/error.h	Sat Aug 14 11:13:17 2021 -0400
@@ -334,9 +334,12 @@
 
     OCTINTERP_API void save_exception (const execution_exception& ee);
 
+    // FIXME
+    //#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS)
     OCTAVE_DEPRECATED (7, "second argument is no longer accepted")
     OCTINTERP_API void display_exception (const execution_exception& ee,
                                           std::ostream& os) const;
+    //#endif
 
     OCTINTERP_API void display_exception (const execution_exception& ee) const;
 
@@ -520,10 +523,12 @@
 
 extern OCTINTERP_API void interpreter_try (octave::unwind_protect&);
 
+#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS)
 OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
 extern OCTINTERP_API int error_state;
 
 OCTAVE_DEPRECATED (6, "this function is obsolete and should not be needed")
 inline void reset_error_handler (void) { }
+#endif
 
 #endif