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:
Mark de Wever 2012-05-20 09:56:05 +00:00
parent 276faf7956
commit cefb8ee330

View file

@ -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)
/**