Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
729441fd
Commit
729441fd
authored
7 years ago
by
Pieter Willemsen
Browse files
Options
Downloads
Patches
Plain Diff
assert: add static_assert if using c11
parent
9e9a1d6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/include/assert.h
+14
-0
14 additions, 0 deletions
core/include/assert.h
with
14 additions
and
0 deletions
core/include/assert.h
+
14
−
0
View file @
729441fd
...
@@ -109,6 +109,20 @@ NORETURN void _assert_failure(const char *file, unsigned line);
...
@@ -109,6 +109,20 @@ NORETURN void _assert_failure(const char *file, unsigned line);
#define assert(cond) ((cond) ? (void)0 : core_panic(PANIC_ASSERT_FAIL, assert_crash_message))
#define assert(cond) ((cond) ? (void)0 : core_panic(PANIC_ASSERT_FAIL, assert_crash_message))
#endif
#endif
#if !defined __cplusplus
#if __STDC_VERSION__ >= 201112L
/**
* @brief c11 static_assert() macro
*/
#define static_assert(...) _Static_assert(__VA_ARGS__)
#else
/**
* @brief static_assert dummy for c-version < c11
*/
#define static_assert(...) struct static_assert_dummy
#endif
#endif
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment