mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
StaticAssert: Avoid unused typedef messages from gcc
This commit is contained in:
@ -67,12 +67,18 @@ class StaticAssertionTest {};
|
||||
#define StaticAssertMacro1(X,Y) StaticAssertMacro2(X,Y)
|
||||
#define StaticAssertMacro2(X,Y) X##Y
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define StaticAssertUnusedTypedef __attribute__((unused))
|
||||
#else
|
||||
#define StaticAssertUnusedTypedef
|
||||
#endif
|
||||
|
||||
//- Assert that some test is true at compile-time
|
||||
#define StaticAssert(Test) \
|
||||
typedef ::Foam::StaticAssertionTest \
|
||||
< \
|
||||
sizeof( ::Foam::StaticAssertionFailed<((Test) ? true : false)>) \
|
||||
> StaticAssertMacro(StaticAssertionTest, __LINE__)
|
||||
> StaticAssertMacro(StaticAssertionTest, __LINE__) StaticAssertUnusedTypedef
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Reference in New Issue
Block a user