Open CASCADE Technology  7.4.0
Macros
Standard_Macro.hxx File Reference

This file is intended to be the first file included to any Open CASCADE source. It defines platform-specific pre-processor macros necessary for correct compilation of Open CASCADE code. More...

Macros

#define Standard_OVERRIDE
 Should be used in declarations of virtual methods overriden in the derived classes, to cause compilation error in the case if that virtual function disappears or changes its signature in the base class. More...
 
#define Standard_FALLTHROUGH
 Should be used in a switch statement immediately before a case label, if code associated with the previous case label may fall through to that next label (i.e. does not end with "break" or "return" etc.). This macro indicates that the fall through is intentional and should not be diagnosed by a compiler that warns on fallthrough. More...
 
#define Standard_NODISCARD
 This attribute may appear in a function declaration, enumeration declaration or class declaration. It tells the compiler to issue a warning, if a return value marked by that attribute is discarded. More...
 
#define Standard_UNUSED
 Macro for marking variables / functions as possibly unused so that compiler will not emit redundant "unused" warnings. More...
 
#define Standard_THREADLOCAL
 Define Standard_THREADLOCAL modifier as C++11 thread_local keyword where it is available. More...
 
#define Standard_DEPRECATED(theMsg)
 Can be used in declaration of a method or a class to mark it as deprecated. Use of such method or class will cause compiler warning (if supported by compiler and unless disabled). If macro OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is defined empty. More...
 
#define Standard_DISABLE_DEPRECATION_WARNINGS
 Disables warnings on use of deprecated features (see Standard_DEPRECATED), from the current point till appearance of Standard_ENABLE_DEPRECATION_WARNINGS macro. This is useful for sections of code kept for backward compatibility and scheduled for removal. More...
 
#define Standard_ENABLE_DEPRECATION_WARNINGS
 Enables warnings on use of deprecated features previously disabled by Standard_DISABLE_DEPRECATION_WARNINGS. More...
 
#define Standard_IMPORT   extern
 
#define Standard_IMPORTC   extern "C"
 

Detailed Description

This file is intended to be the first file included to any Open CASCADE source. It defines platform-specific pre-processor macros necessary for correct compilation of Open CASCADE code.

Macro Definition Documentation

◆ Standard_DEPRECATED

#define Standard_DEPRECATED (   theMsg)

Can be used in declaration of a method or a class to mark it as deprecated. Use of such method or class will cause compiler warning (if supported by compiler and unless disabled). If macro OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is defined empty.

◆ Standard_DISABLE_DEPRECATION_WARNINGS

#define Standard_DISABLE_DEPRECATION_WARNINGS

Disables warnings on use of deprecated features (see Standard_DEPRECATED), from the current point till appearance of Standard_ENABLE_DEPRECATION_WARNINGS macro. This is useful for sections of code kept for backward compatibility and scheduled for removal.

◆ Standard_ENABLE_DEPRECATION_WARNINGS

#define Standard_ENABLE_DEPRECATION_WARNINGS

Enables warnings on use of deprecated features previously disabled by Standard_DISABLE_DEPRECATION_WARNINGS.

◆ Standard_FALLTHROUGH

#define Standard_FALLTHROUGH

Should be used in a switch statement immediately before a case label, if code associated with the previous case label may fall through to that next label (i.e. does not end with "break" or "return" etc.). This macro indicates that the fall through is intentional and should not be diagnosed by a compiler that warns on fallthrough.

Expands to C++17 attribute statement "[[fallthrough]];" on compilers that declare support of C++17, or to "__attribute__((fallthrough));" on GCC 7+.

◆ Standard_IMPORT

#define Standard_IMPORT   extern

◆ Standard_IMPORTC

#define Standard_IMPORTC   extern "C"

◆ Standard_NODISCARD

#define Standard_NODISCARD

This attribute may appear in a function declaration, enumeration declaration or class declaration. It tells the compiler to issue a warning, if a return value marked by that attribute is discarded.

Expands to C++17 attribute statement "[[nodiscard]]" on compilers that declare support of this attribute, or equivalent attribute on GCC.

◆ Standard_OVERRIDE

#define Standard_OVERRIDE

Should be used in declarations of virtual methods overriden in the derived classes, to cause compilation error in the case if that virtual function disappears or changes its signature in the base class.

Expands to C++11 keyword "override" on compilers that are known to suppot it; empty in other cases.

◆ Standard_THREADLOCAL

#define Standard_THREADLOCAL

Define Standard_THREADLOCAL modifier as C++11 thread_local keyword where it is available.

◆ Standard_UNUSED

#define Standard_UNUSED

Macro for marking variables / functions as possibly unused so that compiler will not emit redundant "unused" warnings.

Expands to "__attribute__((unused))" on GCC and CLang.