contract: Enforce user semicolon for all possible expansions by stotko · Pull Request #148 · stotko/stdgpu (original) (raw)
The host versions of the STDGPU_{EXPECTS,ENSURES,ASSERTS} macros are internally defined as if statements which do not require semicolons at the end of the statement. However, this may lead to confusing warnings mentioning superfluous semicolons. Even worse, users might omit the semicolon at the end of the macros and get the impression that this version is more robust and produces less noise.
Fix this undesired behavior by enforcing a semicolon on the user side. This fixes potential warnings and makes wrong usage of the macros, i.e. omitting the semicolon, a compiler error.