NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA Compatibility Management

Macros

#define __attribute__(_x_)
 To allow compiling functions and structs that are using GCC attributes using attribute() in compilers that don't support them. More...
 
#define DLL_EXPORT_ATTR   dllimport
 To hint the compiler that the function should be exposed to the DLL or imported from it, according to the availability of DOCA_EXPORTS. By default, it should be imported. More...
 
#define DOCA_STABLE   __declspec(DLL_EXPORT_ATTR)
 To set a Symbol (or specifically a function) as stable API, i.e. it won't be changed. More...
 
#define DOCA_EXPERIMENTAL   __declspec(deprecated("Symbol is defined as experimental"), DLL_EXPORT_ATTR)
 To set a Symbol (or specifically a function) as experimental. More...
 
#define DOCA_DEPRECATED   __declspec(deprecated("Symbol is defined as deprecated"), DLL_EXPORT_ATTR)
 To set a Symbol (or specifically a function) as deprecated. More...
 
#define DOCA_STRUCT_START   size_t __doca_api_version
 
#define DOCA_STRUCT_GET_VERSION(_X_)   (_X_)->__doca_api_version
 
#define DOCA_STRUCT_CTOR(_X_)   (_X_).__doca_api_version = DOCA_VERSION_EXACT
 
#define DOCA_STRUCT_PTR_CTOR(_X_)   DOCA_STRUCT_CTOR(*(_X_))
 
#define DOCA_STRUCT_MEMSET_CTOR(_X_)
 
#define DOCA_STRUCT_PTR_MEMSET_CTOR(_X_)   DOCA_STRUCT_MEMSET_CTOR(*(_X_))
 
#define DOCA_STRUCT_CTOR_LIST_START   .__doca_api_version = DOCA_VERSION_EXACT
 
#define DOCA_STRUCT_DEF(__st__, __name__)   struct __st__ __name__ = {.__doca_api_version = DOCA_VERSION_EXACT}
 

Detailed Description

Lib to define compatibility with current version, define experimental Symbols.

To set a Symbol (or specifically a function) as experimental:

DOCA_EXPERIMENTAL int func_declare(int param1, int param2);

To remove warnings of experimental compile with "-D DOCA_ALLOW_EXPERIMENTAL_API" To remove warnings of deprecated compile with "-D DOCA_ALLOW_DEPRECATED_API"

Macro Definition Documentation

◆ __attribute__

#define __attribute__ (   _x_)

To allow compiling functions and structs that are using GCC attributes using attribute() in compilers that don't support them.

Definition at line 81 of file doca_compat.h.

◆ DLL_EXPORT_ATTR

#define DLL_EXPORT_ATTR   dllimport

To hint the compiler that the function should be exposed to the DLL or imported from it, according to the availability of DOCA_EXPORTS. By default, it should be imported.

Definition at line 90 of file doca_compat.h.

◆ DOCA_DEPRECATED

#define DOCA_DEPRECATED   __declspec(deprecated("Symbol is defined as deprecated"), DLL_EXPORT_ATTR)

To set a Symbol (or specifically a function) as deprecated.

Definition at line 116 of file doca_compat.h.

◆ DOCA_EXPERIMENTAL

#define DOCA_EXPERIMENTAL   __declspec(deprecated("Symbol is defined as experimental"), DLL_EXPORT_ATTR)

To set a Symbol (or specifically a function) as experimental.

Definition at line 103 of file doca_compat.h.

◆ DOCA_STABLE

#define DOCA_STABLE   __declspec(DLL_EXPORT_ATTR)

To set a Symbol (or specifically a function) as stable API, i.e. it won't be changed.

Definition at line 96 of file doca_compat.h.

◆ DOCA_STRUCT_CTOR

#define DOCA_STRUCT_CTOR (   _X_)    (_X_).__doca_api_version = DOCA_VERSION_EXACT

Definition at line 141 of file doca_compat.h.

◆ DOCA_STRUCT_CTOR_LIST_START

#define DOCA_STRUCT_CTOR_LIST_START   .__doca_api_version = DOCA_VERSION_EXACT

Definition at line 149 of file doca_compat.h.

◆ DOCA_STRUCT_DEF

#define DOCA_STRUCT_DEF (   __st__,
  __name__ 
)    struct __st__ __name__ = {.__doca_api_version = DOCA_VERSION_EXACT}

Definition at line 150 of file doca_compat.h.

◆ DOCA_STRUCT_GET_VERSION

#define DOCA_STRUCT_GET_VERSION (   _X_)    (_X_)->__doca_api_version

Definition at line 140 of file doca_compat.h.

◆ DOCA_STRUCT_MEMSET_CTOR

#define DOCA_STRUCT_MEMSET_CTOR (   _X_)
Value:
do { \
memset(&(_X_), 0, sizeof(_X_)); \
(_X_).__doca_api_version = DOCA_VERSION_EXACT; \
} while (0)
#define DOCA_VERSION_EXACT
Macro of current exact version number.
Definition: doca_version.h:60

Definition at line 143 of file doca_compat.h.

◆ DOCA_STRUCT_PTR_CTOR

#define DOCA_STRUCT_PTR_CTOR (   _X_)    DOCA_STRUCT_CTOR(*(_X_))

Definition at line 142 of file doca_compat.h.

◆ DOCA_STRUCT_PTR_MEMSET_CTOR

#define DOCA_STRUCT_PTR_MEMSET_CTOR (   _X_)    DOCA_STRUCT_MEMSET_CTOR(*(_X_))

Definition at line 148 of file doca_compat.h.

◆ DOCA_STRUCT_START

#define DOCA_STRUCT_START   size_t __doca_api_version

Compatibility Helpers

Definition at line 139 of file doca_compat.h.