make it compile

This commit is contained in:
Hongze Cheng 2024-07-08 17:09:15 +08:00
parent b3be47fdbb
commit 855c6d6295
2 changed files with 10 additions and 12 deletions

View File

@ -18,8 +18,6 @@
#include <stdint.h>
#include "osDef.h"
#ifdef __cplusplus
extern "C" {
#endif
@ -48,11 +46,11 @@ const char* terrstr();
char* taosGetErrMsgReturn();
char* taosGetErrMsg();
int32_t* taosGetErrno();
int32_t* taosGetErrln();
int32_t taosGetErrSize();
extern threadlocal int32_t terrno;
extern threadlocal int32_t terrln;
extern threadlocal char terrMsg[ERR_MSG_LEN];
#define terrno (*taosGetErrno())
#define terrMsg (taosGetErrMsg())
#define terrln (*taosGetErrln())
#define SET_ERROR_MSG(MSG, ...) \
snprintf(terrMsg, ERR_MSG_LEN, MSG, ##__VA_ARGS__)

View File

@ -21,14 +21,14 @@
#define TAOS_ERROR_C
threadlocal int32_t terrno;
threadlocal int32_t terrln;
threadlocal char terrMsg[ERR_MSG_LEN];
static threadlocal int32_t tsErrno;
static threadlocal int32_t tsErrln;
static threadlocal char tsErrMsgDetail[ERR_MSG_LEN] = {0};
static threadlocal char tsErrMsgReturn[ERR_MSG_LEN] = {0};
int32_t* taosGetErrno() { return &terrno; }
char* taosGetErrMsg() { return terrMsg; }
int32_t* taosGetErrno() { return &tsErrno; }
int32_t* taosGetErrln() { return &tsErrln; }
char* taosGetErrMsg() { return tsErrMsgDetail; }
char* taosGetErrMsgReturn() { return tsErrMsgReturn; }
#ifdef TAOS_ERROR_C