From 554c4a7e5608669861d7b122067736cf0b6fe64c Mon Sep 17 00:00:00 2001 From: jwellbelove Date: Wed, 22 Jun 2016 08:31:15 +0100 Subject: [PATCH] Changes for TI Code Composer compatibility. --- src/static_assert.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/static_assert.h b/src/static_assert.h index 00984009..575b9c2b 100644 --- a/src/static_assert.h +++ b/src/static_assert.h @@ -36,13 +36,18 @@ SOFTWARE. #elif defined(ETL_COMPILER_GCC) #define STATIC_ASSERT(Condition, Message) static_assert(Condition, Message) #else - template - struct STATIC_ASSERTION_FAILURE; + template + struct STATIC_ASSERT_FAILED; template <> - struct STATIC_ASSERTION_FAILURE {}; + struct STATIC_ASSERT_FAILED {}; - #define STATIC_ASSERT(Condition, Message) { enum { assertdummy = sizeof(STATIC_ASSERTION_FAILURE<(bool)(Condition)>) }; } + #define ETL_FCAT(a,b) a##b + #define ETL_ACAT(a,b) ETL_FCAT(a,b) + #define STATIC_ASSERT(cond,msg) \ + enum \ + { ETL_ACAT(dummy,__LINE__)=sizeof(STATIC_ASSERT_FAILED<(bool)(cond)>) \ + } #endif #endif