This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

static assert C++ support in app_util.h

Hi!

Most of the project's application code is written in C++. SDK headers are guarded with the extern "C" therefore when including no problems arise with linkage.

The setup is GNUC(SES) and C++11, which makes the library's static asserts broken. When complemented with the following code:

#ifdef __GNUC__
#ifdef __cplusplus
#define STATIC_ASSERT_SIMPLE(EXPR)      static_assert(EXPR, "unspecified message")
#define STATIC_ASSERT_MSG(EXPR, MSG)    static_assert(EXPR, MSG)
#else
#define STATIC_ASSERT_SIMPLE(EXPR)      _Static_assert(EXPR, "unspecified message")
#define STATIC_ASSERT_MSG(EXPR, MSG)    _Static_assert(EXPR, MSG)
#endif
#endif

everything works okay. Will you add this to the SDK too or I have done something wrong?

Related