Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
angle
Commits
d0f8e82b
Commit
d0f8e82b
authored
Sep 30, 2013
by
Geoff Lang
Committed by
Geoff Lang
Oct 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement META_ASSERT with static_assert if the compiler supports it.
TRAC #23948 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
parent
d1e9a9a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
debug.h
src/common/debug.h
+6
-1
No files found.
src/common/debug.h
View file @
d0f8e82b
...
@@ -114,6 +114,11 @@ namespace gl
...
@@ -114,6 +114,11 @@ namespace gl
#endif
#endif
// A macro functioning as a compile-time assert to validate constant conditions
// A macro functioning as a compile-time assert to validate constant conditions
#define META_ASSERT(condition) typedef int COMPILE_TIME_ASSERT_##__LINE__[static_cast<bool>(condition)?1:-1]
#if defined(_MSC_VER) && _MSC_VER >= 1600
#define META_ASSERT_MSG(condition, msg) static_assert(condition, msg)
#else
#define META_ASSERT_MSG(condition, msg) typedef int COMPILE_TIME_ASSERT_##__LINE__[static_cast<bool>(condition)?1:-1]
#endif
#define META_ASSERT(condition) META_ASSERT_MSG(condition, "compile time assertion failed.")
#endif // COMMON_DEBUG_H_
#endif // COMMON_DEBUG_H_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment