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
2bd1d7f0
You need to sign in or sign up before continuing.
Commit
2bd1d7f0
authored
6 years ago
by
Matthew Blue
Browse files
Options
Downloads
Patches
Plain Diff
core/assert: provide static_assert for c99
parent
75291335
No related branches found
Branches containing commit
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
+5
-2
5 additions, 2 deletions
core/include/assert.h
with
5 additions
and
2 deletions
core/include/assert.h
+
5
−
2
View file @
2bd1d7f0
...
...
@@ -114,9 +114,12 @@ NORETURN void _assert_failure(const char *file, unsigned line);
#define static_assert(...) _Static_assert(__VA_ARGS__)
#else
/**
* @brief static_assert dummy for c-version < c11
* @brief static_assert for c-version < c11
*
* Generates a division by zero compile error when cond is false
*/
#define static_assert(...) struct static_assert_dummy
#define static_assert(cond, ...) \
enum { static_assert_failed_on_div_by_0 = 1 / (!!(cond)) }
#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