summaryrefslogtreecommitdiff
path: root/AK/Assertions.h
diff options
context:
space:
mode:
authorPaul Scharnofske <31994781+asynts@users.noreply.github.com>2020-08-25 16:20:52 +0200
committerGitHub <noreply@github.com>2020-08-25 16:20:52 +0200
commit88a2c245e528b7ee728d7426982d24543485036b (patch)
tree08c6f96ad983ed6cf5dd3a68234538bfb79c8e7f /AK/Assertions.h
parentc2b9f8857c7b9189dab5eca8be06ecc8811968eb (diff)
downloadserenity-88a2c245e528b7ee728d7426982d24543485036b.zip
AK: TestSuite: Define assert macros with do { } while(0). (#3292)
Consider the following scenario: if(condition) FOO(); else bar(); Suppose FOO is defined as follows: #define FOO() { bar(); baz(); } Then it expands to the following: if(condition) // Syntax error, we are not allowed to put a semicolon at the end. { bar(); baz(); }; else bar(); If we define FOO as follows: #define FOO() do { bar(); baz(); } while(false) Then it expands to the following: if(condition) do { bar(); baz(); } while(false); else bar(); Which is correct.
Diffstat (limited to 'AK/Assertions.h')
0 files changed, 0 insertions, 0 deletions