XMSS Library
compat.h File Reference

C99 compatibility layer. More...

#include "xmss_config.h"
Include dependency graph for compat.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define XMSS_COMPAT_H_INCLUDED
 Include guard.
 
#define XMSS_STATIC_ASSERT(cond, msg)   _Static_assert(cond, msg)
 Syntactical equivalent of _Static_assert(), which is C11. More...
 

Detailed Description

C99 compatibility layer.

There is no need to include this header explicitly. Instead, include either verification.h or signing.h.

The XMSS library is compatible with C99 compilers, but it also allows certain C11 features if they are available for the compiler at hand. This header ensures that the code does not get cluttered with preprocessor #ifs. You can simply use the compatibility macros defined here, which will automatically either use the C11 feature (when available) or become a no-op (when not available).

Macro Definition Documentation

◆ XMSS_STATIC_ASSERT

#define XMSS_STATIC_ASSERT (   cond,
  msg 
)    _Static_assert(cond, msg)

Syntactical equivalent of _Static_assert(), which is C11.

C11 supports _Static_assert(). CMake can detect if it is available anyway, even if the compiler is not C11. If CMake detects that static asserts are not supported, then this macro is a no-op.

See also
XMSS_CAN_USE_STATIC_ASSERT
XMSS_CAN_USE_EXTENSION_STATIC_ASSERT