Skip to content

Commit

Permalink
PATCH libmacro: Reduce BUILD_BUG_ON() for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
leiless committed Apr 13, 2019
1 parent 45bba0e commit 29d5af8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libmacro/libmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extern "C" {
* MSVC compiler allows negative array size(treat as unsigned value)
* yet them don't allow zero-size array
*/
#define BUILD_BUG_ON(cond) ((void) sizeof(char[1 - !!(cond)]))
#define BUILD_BUG_ON(cond) ((void) sizeof(char[!(cond)]))
#else
#define BUILD_BUG_ON(cond) ((void) sizeof(char[1 - 2 * !!(cond)]))
#endif
Expand Down

0 comments on commit 29d5af8

Please sign in to comment.