index-pack: rename struct thread_local
"thread_local" is a keyword in C23. To make sure that our code compiles on a wide variety of C versions, rename struct thread_local to "struct thread_local_data" to avoid a conflict. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Nov 17, 2024 at 01:31 UTC
e8b3bcf49120309b207b7afc25c4aa81b866ac45
1 file changed
+5
-5
builtin/index-pack.c
+5
-5
@@ -94,7 +94,7 @@ static LIST_HEAD(done_head);
94
static size_t base_cache_used;
95
static size_t base_cache_limit;
96
97
-struct thread_local {
97
+struct thread_local_data {
98
pthread_t thread;
99
int pack_fd;
100
};
@@ -117,7 +117,7 @@ static struct object_entry *objects;
117
static struct object_stat *obj_stat;
118
static struct ofs_delta_entry *ofs_deltas;
119
static struct ref_delta_entry *ref_deltas;
120
-static struct thread_local nothread_data;
120
+static struct thread_local_data nothread_data;
121
static int nr_objects;
122
static int nr_ofs_deltas;
123
static int nr_ref_deltas;
@@ -148,7 +148,7 @@ static uint32_t input_crc32;
148
static int input_fd, output_fd;
149
static const char *curr_pack;
150
151
-static struct thread_local *thread_data;
151
+static struct thread_local_data *thread_data;
152
static int nr_dispatched;
153
static int threads_active;
154
@@ -390,7 +390,7 @@ static NORETURN void bad_object(off_t offset, const char *format, ...)
390
(uintmax_t)offset, buf);
391
}
392
393
-static inline struct thread_local *get_thread_data(void)
393
+static inline struct thread_local_data *get_thread_data(void)
394
{
395
if (HAVE_THREADS) {
396
if (threads_active)
@@ -401,7 +401,7 @@ static inline struct thread_local *get_thread_data(void)
401
return ¬hread_data;
402
}
403
404
-static void set_thread_data(struct thread_local *data)
404
+static void set_thread_data(struct thread_local_data *data)
405
{
406
if (threads_active)
407
pthread_setspecific(key, data);