mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-06-28 15:39:02 +08:00
Use TLS macro for cross-platform thread-local storage
This commit is contained in:
parent
c137d64d13
commit
f0d435ecdb
@ -294,7 +294,7 @@ mdb_get_colbacktype_string(const MdbColumn *col)
|
|||||||
const MdbBackendType *type = mdb_get_colbacktype(col);
|
const MdbBackendType *type = mdb_get_colbacktype(col);
|
||||||
if (!type) {
|
if (!type) {
|
||||||
// return NULL;
|
// return NULL;
|
||||||
static __thread char buf[16];
|
static TLS char buf[16];
|
||||||
snprintf(buf, sizeof(buf), "Unknown_%04x", col->col_type);
|
snprintf(buf, sizeof(buf), "Unknown_%04x", col->col_type);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
|
|
||||||
static __thread unsigned long opts;
|
static TLS unsigned long opts;
|
||||||
static __thread int optset;
|
static TLS int optset;
|
||||||
|
|
||||||
static void load_options(void);
|
static void load_options(void);
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ void FreeConnectParams (ConnectParams* params)
|
|||||||
|
|
||||||
gchar* GetConnectParam (ConnectParams* params, const gchar* paramName)
|
gchar* GetConnectParam (ConnectParams* params, const gchar* paramName)
|
||||||
{
|
{
|
||||||
static __thread char tmp[FILENAME_MAX];
|
static TLS char tmp[FILENAME_MAX];
|
||||||
|
|
||||||
/* use old servername */
|
/* use old servername */
|
||||||
tmp[0] = '\0';
|
tmp[0] = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user