]> git.ipfire.org Git - thirdparty/git.git/commitdiff
index-pack: rename struct thread_local
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 17 Nov 2024 01:31:48 +0000 (01:31 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Nov 2024 00:42:08 +0000 (09:42 +0900)
"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>
builtin/index-pack.c

index e228c56ff2701b5e70fcb57962e4af6979dd809f..74675dbd6c922134bebce075419c369be1639d83 100644 (file)
@@ -94,7 +94,7 @@ static LIST_HEAD(done_head);
 static size_t base_cache_used;
 static size_t base_cache_limit;
 
-struct thread_local {
+struct thread_local_data {
        pthread_t thread;
        int pack_fd;
 };
@@ -117,7 +117,7 @@ static struct object_entry *objects;
 static struct object_stat *obj_stat;
 static struct ofs_delta_entry *ofs_deltas;
 static struct ref_delta_entry *ref_deltas;
-static struct thread_local nothread_data;
+static struct thread_local_data nothread_data;
 static int nr_objects;
 static int nr_ofs_deltas;
 static int nr_ref_deltas;
@@ -148,7 +148,7 @@ static uint32_t input_crc32;
 static int input_fd, output_fd;
 static const char *curr_pack;
 
-static struct thread_local *thread_data;
+static struct thread_local_data *thread_data;
 static int nr_dispatched;
 static int threads_active;
 
@@ -390,7 +390,7 @@ static NORETURN void bad_object(off_t offset, const char *format, ...)
            (uintmax_t)offset, buf);
 }
 
-static inline struct thread_local *get_thread_data(void)
+static inline struct thread_local_data *get_thread_data(void)
 {
        if (HAVE_THREADS) {
                if (threads_active)
@@ -401,7 +401,7 @@ static inline struct thread_local *get_thread_data(void)
        return &nothread_data;
 }
 
-static void set_thread_data(struct thread_local *data)
+static void set_thread_data(struct thread_local_data *data)
 {
        if (threads_active)
                pthread_setspecific(key, data);