Compare commits

...

1 Commits

Author SHA1 Message Date
c4fd22542d fixed IGNORE_RESULT macro bug 2026-01-09 09:47:41 +05:00

View File

@@ -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_){ \