提交 f3514d17 authored 作者: 周尚's avatar 周尚

update AW_errnum declaration for Windows compile

上级 f50c1dd0
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if !defined(WIN32) && !defined(__MINGW32__)
__thread AW_errno AW_errnum; __thread AW_errno AW_errnum;
#else
AW_errno AW_errnum;
#endif
struct AW_strerror struct AW_strerror
{ {
......
...@@ -19,23 +19,24 @@ ...@@ -19,23 +19,24 @@
XX(SUCC, "SUCCESS") \ XX(SUCC, "SUCCESS") \
\ \
/* use system errno */ \ /* use system errno */ \
XX(ERR_SYS, "use strerror instead") \ XX(ERR_SYS, "Use strerror instead") \
\ \
/* SQLite error */ \ /* SQLite error */ \
XX(ERR_SQLITE, "call sqlite_errmsg() after") \ XX(ERR_SQLITE, "Call sqlite_errmsg() after") \
XX(ERR_SQLITE_NOT_FOUND, "No result found") \ XX(ERR_SQLITE_NOT_FOUND, "No result found") \
\ \
/* MySQL error */ \ /* MySQL error */ \
XX(ERR_MYSQL, "call mysql_error() after ") \ XX(ERR_MYSQL, "Call mysql_error() for detail ") \
\ \
/* Custom error */ \ /* Custom error */ \
XX(ERR_INVALID_ADDR, "invalid memory address") \ XX(ERR_INVALID_ADDR, "Invalid memory address") \
XX(ERR_INVALID_TYPE, "invalid data type") \ XX(ERR_INVALID_TYPE, "Invalid data type") \
XX(ERR_NO_MEMORY, "No enough memory") \ XX(ERR_NO_MEMORY, "No enough memory") \
XX(ERR_NO_FILE, "Check if file exists") \ XX(ERR_NO_FILE, "Check if file exists") \
XX(ERR_NO_DATA, "No data found") \
\ \
XX(ERR_SQL_INVALID_METHOD, "Invalid sql method") \ XX(ERR_SQL_INVALID_METHOD, "Invalid sql method") \
XX(ERR_SQL_CONN, "connect error, check parameters") \ XX(ERR_SQL_CONN, "Connect error, check parameters") \
\ \
/* unknown error */ \ /* unknown error */ \
XX(ERR_UNKNOWN, "Unexpected error occurred") XX(ERR_UNKNOWN, "Unexpected error occurred")
...@@ -61,4 +62,9 @@ typedef enum ...@@ -61,4 +62,9 @@ typedef enum
const char* AW_ERR_name(AW_errno errnum); const char* AW_ERR_name(AW_errno errnum);
const char* AW_ERR_desc(AW_errno errnum); const char* AW_ERR_desc(AW_errno errnum);
#if !defined(WIN32) && !defined(__MINGW32__)
extern __thread AW_errno AW_errnum; extern __thread AW_errno AW_errnum;
#else
extern AW_errno AW_errnum;
#endif
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论