fixed IGNORE_RESULT macro bug
This commit is contained in:
@@ -73,8 +73,11 @@ typedef struct Result_ {
|
|||||||
/// Warning can be suppressed by IGNORE_RESULT
|
/// Warning can be suppressed by IGNORE_RESULT
|
||||||
#define Result(T) Result_ ATTRIBUTE_WARN_UNUSED_RESULT
|
#define Result(T) Result_ ATTRIBUTE_WARN_UNUSED_RESULT
|
||||||
#define ResultVar(T) Result_
|
#define ResultVar(T) Result_
|
||||||
|
|
||||||
|
// for some stupid reason gcc requires more than 3 levels of macros to concat token with line number
|
||||||
|
#define _ignore_var_name(N) CAT2(__ignored_, N)
|
||||||
///USAGE: IGNORE_RESULT trySomething();
|
///USAGE: IGNORE_RESULT trySomething();
|
||||||
#define IGNORE_RESULT Result_ __ignored_##__LINE__ ATTRIBUTE_UNUSED =
|
#define IGNORE_RESULT Result_ _ignore_var_name(__LINE__) ATTRIBUTE_UNUSED =
|
||||||
|
|
||||||
|
|
||||||
#define RESULT_ERROR_CODE(CODE_PAGE, CODE, MSG, IS_MSG_ON_HEAP) (Result_){ \
|
#define RESULT_ERROR_CODE(CODE_PAGE, CODE, MSG, IS_MSG_ON_HEAP) (Result_){ \
|
||||||
|
|||||||
Reference in New Issue
Block a user