Created
June 20, 2017 21:29
-
-
Save nirbhayc/78c2e1cd86459f2d8f6ace66ca598b77 to your computer and use it in GitHub Desktop.
(Blog) Compile-time assertion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define compile_time_assert(expr) \ | |
do \ | |
{ \ | |
typedef char compile_time_assert[(expr) ? 1 : -1] __attribute__((unused)); \ | |
} while(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment