libvpb  4.2.61
vt_deprecated.h File Reference

Deprecated symbol handling. More...

This graph shows which files directly or indirectly include this file:

Macros

#define VT_COMPILER_GCC(major, minor)   0
 Compiler version test. More...
 
Code deprecating macros

Use these macros to mark deprecated code if you wish to generate compile time warnings about its continued use.

#define VT_DEPRECATED(x)
 Macro wrapper for deprecated symbols. More...
 
#define VT_DEPRECATED_MACRO
 Helper for deprecated macros. More...
 

Functions

Macro-deprecating helper
 Deprecated::VT_DEPRECATED (typedef int Macro)
 Parasitic type used to generate VT_DEPRECATED_MACRO warnings.
 

Detailed Description

Deprecated symbol handling.

Macro Definition Documentation

◆ VT_COMPILER_GCC

#define VT_COMPILER_GCC (   major,
  minor 
)    0

Compiler version test.

This macro will return false if the version of gcc in use is earlier than the specified major, minor limit, or if gcc is not being used. Otherwise it will evaluate to be true.

◆ VT_DEPRECATED

#define VT_DEPRECATED (   x )

Macro wrapper for deprecated symbols.

You can use this macro to generate compile time warnings for deprecated functions and methods, variables, and types, by simply wrapping an existing declaration with it or creating one that matches the existing definition. You cannot wrap definitions or implicitly inline methods with it, a separate declaration must exist.

Parameters
xThe symbol declaration to deprecate.

For example:

VT_DEPRECATED( typedef int DeprecatedType );
VT_DEPRECATED( void DeprecatedFunctionDecl( int arg ) );
VT_DEPRECATED( bool DeprecatedFlagVariable );
#define VT_DEPRECATED(x)
Macro wrapper for deprecated symbols.
Definition: vt_deprecated.h:57

◆ VT_DEPRECATED_MACRO

#define VT_DEPRECATED_MACRO

Helper for deprecated macros.

Include this macro somewhere harmless (eg. hidden in a comma operator or empty statement) in a macro definition to get compile time warnings about its continued use.

For example:

#define OLD_MACRO( arg ) ( VT_DEPRECATED_MACRO, OldMacroFunction( arg ) )