EDT PDV SDK Documentation 6.1.0
edt_portability.h File Reference

(git 0f985b7, 2023-10-04)

Defines and macros for compiler portability or platform compatibility. More...

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


#define EDT_STR_FORMAT_ATTR(archetype, fmt_string_index, first_to_check)    __attribute__((__format__(archetype, fmt_string_index, first_to_check)))
#define EDT_CHECK_RETURN   __attribute__((__warn_unused_result__))
#define EDT_DEPRECATED_FUNC(as_of_version, explanation)    __attribute__((__deprecated__(EDT_DEPRECATED_FUNC_MSG_(as_of_version, explanation))))

Detailed Description

Defines and macros for compiler portability or platform compatibility.

Macro Definition Documentation



By default, linking to a shared library is assumed. To link to a static library, users should define EDT_API_LIBSHARED=0 to disable shared library exports in header files.


#define EDT_DEALLOCATE_WITH (   x)

The memory allocated by the decorated function should be free'd by calling the function x.

  • GCC function attribute "malloc(<deallocator>)"


#define EDT_STR_FORMAT_ATTR (   archetype,
)     __attribute__((__format__(archetype, fmt_string_index, first_to_check)))

A wrapper for adding the 'format' function attribute to allow the compiler to type-check the format string and variadic arguments.

  • GCC function attribute "format"
archetypeStyle of formatting arguments, such as 'printf' or 'scanf'.
fmt_string_indexFunction parameter index of the format string.
first_to_checkFunction parameter index of the first variadic argument. Should be zero (0) for functions where arguments are not available to be checked.


#define EDT_CHECK_RETURN   __attribute__((__warn_unused_result__))

The caller should inspect the return value of the decorated function.

Dev note: Both the function declaration and definition should be decorated, for MSVC analysis.

  • GCC function attribute "warn_unused_result"
  • Microsoft Visual Studio property "_Check_return_" and warning C6031


#define EDT_DEPRECATED_FUNC (   as_of_version,
)     __attribute__((__deprecated__(EDT_DEPRECATED_FUNC_MSG_(as_of_version, explanation))))

The decorated function is deprecated and may be removed in a future release.

  • GCC function attribute "deprecated"
  • Microsoft Visual Studio "__declspec(deprecated)" and warning C4996