OSVR-Core
Macros
AnnotationMacrosC.h File Reference

Header containing macros for source-level annotation. More...

Go to the source code of this file.

Macros

#define OSVR_RETURN_SUCCESS_CONDITION(X)
 Applied to a typedef, indicates the condition for return under which a function returning it should be considered to have succeeded (thus holding certain specifications). More...
 
Parameter annotations

These indicate the role and valid values for parameters to functions.

At most one of these should be placed before a parameter's type name in the function parameter list, in both the declaration and definition. (They must match!)

#define OSVR_IN
 Indicates a required function parameter that serves only as input.
 
#define OSVR_IN_PTR
 Indicates a required pointer (non-null) function parameter that serves only as input.
 
#define OSVR_IN_OPT
 Indicates a function parameter (pointer) that serves only as input, but is optional and might be NULL.
 
#define OSVR_IN_STRZ
 Indicates a null-terminated string function parameter that serves only as input.
 
#define OSVR_IN_READS(NUM_ELEMENTS)
 Indicates a buffer containing input with the specified number of elements. More...
 
#define OSVR_OUT
 Indicates a required function parameter that serves only as output. More...
 
#define OSVR_OUT_PTR
 Indicates a required pointer (non-null) function parameter that serves only as output.
 
#define OSVR_OUT_OPT
 Indicates a function parameter (pointer) that serves only as output, but is optional and might be NULL.
 
#define OSVR_INOUT
 Indicates a required function parameter that is both read and written to. More...
 
#define OSVR_INOUT_PTR
 Indicates a required pointer (non-null) function parameter that is both read and written to.
 
Function annotations

These indicate particular relevant aspects about a function.

Some duplicate the effective meaning of parameter annotations: applying both allows the fullest extent of static analysis tools to analyze the code, and in some compilers, generate warnings.

#define OSVR_FUNC_NONNULL(X)
 Indicates the parameter(s) that must be non-null. More...
 
#define OSVR_RETURN_WARN_UNUSED
 Indicates the function has a return value that must be used (either a security problem or an obvious bug if not). More...
 

Detailed Description

Header containing macros for source-level annotation.

In theory, supporting MSVC SAL, as well as compatible GCC and Clang attributes. In practice, expanded as time allows and requires.

Must be c-safe!

Date
2014
Author
Sensics, Inc. http://sensics.com/osvr