Mercurial > octave
comparison liboctave/util/quit.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 | 76deb8194590 |
children | eff73c13fcf3 796f54d4ddbf |
comparison
equal
deleted
inserted
replaced
29953:e35442c969f5 | 29954:4c88a452519c |
---|---|
222 0: no interrupt pending | 222 0: no interrupt pending |
223 < 0: handling interrupt | 223 < 0: handling interrupt |
224 */ | 224 */ |
225 extern OCTAVE_API sig_atomic_t octave_interrupt_state; | 225 extern OCTAVE_API sig_atomic_t octave_interrupt_state; |
226 | 226 |
227 #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) | |
227 OCTAVE_DEPRECATED (6, "'octave_exception_state' is an obsolete internal variable; any uses should be removed") | 228 OCTAVE_DEPRECATED (6, "'octave_exception_state' is an obsolete internal variable; any uses should be removed") |
228 extern OCTAVE_API sig_atomic_t octave_exception_state; | 229 extern OCTAVE_API sig_atomic_t octave_exception_state; |
230 #endif | |
229 | 231 |
230 extern OCTAVE_API volatile sig_atomic_t octave_signal_caught; | 232 extern OCTAVE_API volatile sig_atomic_t octave_signal_caught; |
231 | 233 |
232 extern OCTAVE_API void octave_handle_signal (void); | 234 extern OCTAVE_API void octave_handle_signal (void); |
233 | 235 |
236 #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) | |
234 OCTAVE_DEPRECATED (6, "use 'throw octave::interrupt_exception' instead") | 237 OCTAVE_DEPRECATED (6, "use 'throw octave::interrupt_exception' instead") |
235 OCTAVE_NORETURN extern OCTAVE_API void octave_throw_interrupt_exception (void); | 238 OCTAVE_NORETURN extern OCTAVE_API void octave_throw_interrupt_exception (void); |
236 | 239 |
237 OCTAVE_DEPRECATED (6, "use 'throw octave::execution_exception' instead") | 240 OCTAVE_DEPRECATED (6, "use 'throw octave::execution_exception' instead") |
238 OCTAVE_NORETURN extern OCTAVE_API void octave_throw_execution_exception (void); | 241 OCTAVE_NORETURN extern OCTAVE_API void octave_throw_execution_exception (void); |
240 OCTAVE_DEPRECATED (6, "use 'throw std::bad_alloc' instead") | 243 OCTAVE_DEPRECATED (6, "use 'throw std::bad_alloc' instead") |
241 OCTAVE_NORETURN extern OCTAVE_API void octave_throw_bad_alloc (void); | 244 OCTAVE_NORETURN extern OCTAVE_API void octave_throw_bad_alloc (void); |
242 | 245 |
243 OCTAVE_DEPRECATED (6, "use 'throw' instead") | 246 OCTAVE_DEPRECATED (6, "use 'throw' instead") |
244 extern OCTAVE_API void octave_rethrow_exception (void); | 247 extern OCTAVE_API void octave_rethrow_exception (void); |
248 #endif | |
245 | 249 |
246 #if defined (__cplusplus) | 250 #if defined (__cplusplus) |
247 | 251 |
248 inline void octave_quit (void) | 252 inline void octave_quit (void) |
249 { | 253 { |
306 outside of any extern "C" block. */ | 310 outside of any extern "C" block. */ |
307 | 311 |
308 extern OCTAVE_API void (*octave_signal_hook) (void); | 312 extern OCTAVE_API void (*octave_signal_hook) (void); |
309 extern OCTAVE_API void (*octave_interrupt_hook) (void); | 313 extern OCTAVE_API void (*octave_interrupt_hook) (void); |
310 | 314 |
315 #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) | |
311 OCTAVE_DEPRECATED (6, "'octave_bad_alloc_hook' is obsolete and no longer used") | 316 OCTAVE_DEPRECATED (6, "'octave_bad_alloc_hook' is obsolete and no longer used") |
312 extern OCTAVE_API void (*octave_bad_alloc_hook) (void); | 317 extern OCTAVE_API void (*octave_bad_alloc_hook) (void); |
313 | 318 #endif |
314 #endif | 319 |
315 | 320 #endif |
316 #endif | 321 |
322 #endif |