Skip to content

Commit e8b3bcf

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 777489f commit e8b3bcf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/index-pack.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static LIST_HEAD(done_head);
9494
static size_t base_cache_used;
9595
static size_t base_cache_limit;
9696

97-
struct thread_local {
97+
struct thread_local_data {
9898
pthread_t thread;
9999
int pack_fd;
100100
};
@@ -117,7 +117,7 @@ static struct object_entry *objects;
117117
static struct object_stat *obj_stat;
118118
static struct ofs_delta_entry *ofs_deltas;
119119
static struct ref_delta_entry *ref_deltas;
120-
static struct thread_local nothread_data;
120+
static struct thread_local_data nothread_data;
121121
static int nr_objects;
122122
static int nr_ofs_deltas;
123123
static int nr_ref_deltas;
@@ -148,7 +148,7 @@ static uint32_t input_crc32;
148148
static int input_fd, output_fd;
149149
static const char *curr_pack;
150150

151-
static struct thread_local *thread_data;
151+
static struct thread_local_data *thread_data;
152152
static int nr_dispatched;
153153
static int threads_active;
154154

@@ -390,7 +390,7 @@ static NORETURN void bad_object(off_t offset, const char *format, ...)
390390
(uintmax_t)offset, buf);
391391
}
392392

393-
static inline struct thread_local *get_thread_data(void)
393+
static inline struct thread_local_data *get_thread_data(void)
394394
{
395395
if (HAVE_THREADS) {
396396
if (threads_active)
@@ -401,7 +401,7 @@ static inline struct thread_local *get_thread_data(void)
401401
return &nothread_data;
402402
}
403403

404-
static void set_thread_data(struct thread_local *data)
404+
static void set_thread_data(struct thread_local_data *data)
405405
{
406406
if (threads_active)
407407
pthread_setspecific(key, data);

0 commit comments

Comments
 (0)