projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use _Static_assert() if available
[fio.git]
/
compiler
/
compiler.h
diff --git
a/compiler/compiler.h
b/compiler/compiler.h
index 40e857c004c6e4304565ad1e446b4bffaf90eb35..a6a74322549fc66f3210dc9b52406d1fd43a5475 100644
(file)
--- a/
compiler/compiler.h
+++ b/
compiler/compiler.h
@@
-1,5
+1,6
@@
#ifndef FIO_COMPILER_H
#define FIO_COMPILER_H
#ifndef FIO_COMPILER_H
#define FIO_COMPILER_H
+#include <assert.h>
#if __GNUC__ >= 4
#include "compiler-gcc4.h"
#if __GNUC__ >= 4
#include "compiler-gcc4.h"
@@
-33,6
+34,11
@@
1; \
})
1; \
})
+
+#if defined(CONFIG_STATIC_ASSERT)
+#define compiletime_assert(condition, msg) _Static_assert(condition, msg)
+
+#else
#ifndef __compiletime_error
#define __compiletime_error(message)
#endif
#ifndef __compiletime_error
#define __compiletime_error(message)
#endif
@@
-56,3
+62,5
@@
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
#endif
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
#endif
+
+#endif