Mbed OS Reference
Loading...
Searching...
No Matches
common.h File Reference

Utility macros for internal use in the library. More...

#include "mbedtls/config.h"

Go to the source code of this file.

Macros

#define MBEDTLS_STATIC_TESTABLE   static
 Helper to define a function as static except when building invasive tests. More...
 

Detailed Description

Utility macros for internal use in the library.

Definition in file common.h.

Macro Definition Documentation

◆ MBEDTLS_STATIC_TESTABLE

#define MBEDTLS_STATIC_TESTABLE   static

Helper to define a function as static except when building invasive tests.

If a function is only used inside its own source file and should be declared static to allow the compiler to optimize for code size, but that function has unit tests, define it with

MBEDTLS_STATIC_TESTABLE int mbedtls_foo(...) { ... }
#define MBEDTLS_STATIC_TESTABLE
Helper to define a function as static except when building invasive tests.
Definition: common.h:50

and declare it in a header in the library/ directory with

#if defined(MBEDTLS_TEST_HOOKS)
int mbedtls_foo(...);
#endif

Definition at line 50 of file common.h.