Mercurial > octave
diff liboctave/array/Range.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 | 29a1f8fd8ee6 |
children | e424d966dca7 |
line wrap: on
line diff
--- a/liboctave/array/Range.h Sat Aug 14 10:40:21 2021 -0400 +++ b/liboctave/array/Range.h Sat Aug 14 11:13:17 2021 -0400 @@ -375,6 +375,7 @@ { public: +#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) OCTAVE_DEPRECATED (7, "use the 'octave::range<double>' class instead") Range (void) : m_base (0), m_limit (0), m_inc (0), m_numel (0) @@ -390,6 +391,7 @@ : m_base (r.base ()), m_limit (r.final_value ()), m_inc (r.increment ()), m_numel (r.numel ()) { } +#endif Range (const Range& r) = default; @@ -397,6 +399,7 @@ ~Range (void) = default; +#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) OCTAVE_DEPRECATED (7, "use the 'octave::range<double>' class instead") Range (double b, double l) : m_base (b), m_limit (l), m_inc (1), m_numel (numel_internal ()) @@ -426,6 +429,7 @@ if (! octave::math::isinf (m_limit)) m_limit = limit_internal (); } +#endif // The range has a finite number of elements. bool ok (void) const @@ -537,6 +541,7 @@ { } }; +#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) OCTAVE_DEPRECATED (7, "arithmetic operations on Range objects are unreliable") extern OCTAVE_API Range operator - (const Range& r); @@ -557,5 +562,6 @@ OCTAVE_DEPRECATED (7, "arithmetic operations on Range objects are unreliable") extern OCTAVE_API Range operator * (const Range& r, double x); +#endif #endif