Skip to content

Commit

Permalink
fix static_assert macros
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Sep 19, 2017
1 parent c9645d5 commit d49baff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/ua_config.h.in
Expand Up @@ -252,9 +252,10 @@ typedef uint8_t bool;
* Example usage:
* UA_STATIC_ASSERT(sizeof(long)==7, use_another_compiler_luke)
* See: https://stackoverflow.com/a/4815532/869402 */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L /* C11 */
# define UA_STATIC_ASSERT(cond,msg) \
_Static_assert(cond, msg)
#if defined(__cplusplus) && __cplusplus >= 201103L /* C++11 or above */
# define UA_STATIC_ASSERT(cond,msg) static_assert(cond, #msg)
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L /* C11 or above */
# define UA_STATIC_ASSERT(cond,msg) _Static_assert(cond, #msg)
#elif defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) /* GCC, Clang, MSC */
# define UA_CTASTR2(pre,post) pre ## post
# define UA_CTASTR(pre,post) UA_CTASTR2(pre,post)
Expand Down

0 comments on commit d49baff

Please sign in to comment.