From bc70d8e3384b460f00f784996f0640c5abc99bf3 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 15 Jul 2024 16:08:20 +0800 Subject: [PATCH] more define --- include/util/tutil.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/util/tutil.h b/include/util/tutil.h index 5360454501..e6d9b4fdd9 100644 --- a/include/util/tutil.h +++ b/include/util/tutil.h @@ -147,11 +147,16 @@ static FORCE_INLINE int32_t taosGetTbHashVal(const char *tbname, int32_t tblen, #define TCONTAINER_OF(ptr, type, member) ((type *)((char *)(ptr)-offsetof(type, member))) +#define TAOS_RETURN(code) \ + do { \ + return (terrno = (code)); \ + } while (0) + #define TAOS_CHECK_RETURN(CMD) \ do { \ int32_t code = (CMD); \ if (code != TSDB_CODE_SUCCESS) { \ - return (terrno = code); \ + TAOS_RETURN(code); \ } \ } while (0) @@ -165,11 +170,6 @@ static FORCE_INLINE int32_t taosGetTbHashVal(const char *tbname, int32_t tblen, } \ } while (0) -#define TAOS_RETURN(code) \ - do { \ - return (terrno = (code)); \ - } while (0) - #ifdef __cplusplus } #endif