Use TLS macro for cross-platform thread-local storage

This commit is contained in:
Evan Miller
2021-09-08 09:09:03 -04:00
parent c137d64d13
commit f0d435ecdb
3 changed files with 5 additions and 5 deletions

View File

@@ -294,7 +294,7 @@ mdb_get_colbacktype_string(const MdbColumn *col)
const MdbBackendType *type = mdb_get_colbacktype(col);
if (!type) {
// return NULL;
static __thread char buf[16];
static TLS char buf[16];
snprintf(buf, sizeof(buf), "Unknown_%04x", col->col_type);
return buf;
}

View File

@@ -24,8 +24,8 @@
#define DEBUG 1
static __thread unsigned long opts;
static __thread int optset;
static TLS unsigned long opts;
static TLS int optset;
static void load_options(void);