Add hint for the compiler that FAIL is a failure.
In some contexts the compiler may warn since the wml_exception has no attribute indicating it will never return. The answer is throwing a dummy exception.
This commit is contained in:
parent
276faf7956
commit
cefb8ee330
1 changed files with 6 additions and 0 deletions
|
@ -69,6 +69,9 @@ class display;
|
|||
#define FAIL(message) \
|
||||
do { \
|
||||
wml_exception(NULL, __FILE__, __LINE__, __func__, message); \
|
||||
/* wml_exception never returns. */ \
|
||||
/* Help the compiler to figure that out */ \
|
||||
throw 42; \
|
||||
} while(0)
|
||||
|
||||
#define FAIL_WITH_DEV_MESSAGE(message, dev_message) \
|
||||
|
@ -79,6 +82,9 @@ class display;
|
|||
, __func__ \
|
||||
, message \
|
||||
, dev_message); \
|
||||
/* wml_exception never returns. */ \
|
||||
/* Help the compiler to figure that out */ \
|
||||
throw 42; \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue