200620.1.1 · 21eaa1c4160b868b0c5bbf59da17974429f30055
Fix multiple global symbols definitions.
See the use of extern here:
* https://www.geeksforgeeks.org/understanding-extern-keyword-in-c/
* https://en.wikipedia.org/wiki/External_variable
* https://stackoverflow.com/questions/496448/how-to-correctly-use-the-extern-keyword-in-c
reading declarations
Changes to src/search.h. All files
@@ -31,9 +31,9 @@ #include "uthash.h" #include "util.h" -size_t alpha_skip_lookup[256];-size_t *find_skip_lookup;-uint8_t h_table[H_SIZE] __attribute__((aligned(64)));+extern size_t alpha_skip_lookup[256];+extern size_t *find_skip_lookup;+extern uint8_t h_table[H_SIZE] __attribute__((aligned(64))); struct work_queue_t { char *path;@@ -41,12 +41,12 @@ struct work_queue_t { }; typedef struct work_queue_t work_queue_t; -work_queue_t *work_queue;-work_queue_t *work_queue_tail;-int done_adding_files;-pthread_cond_t files_ready;-pthread_mutex_t stats_mtx;-pthread_mutex_t work_queue_mtx;+extern work_queue_t *work_queue;+extern work_queue_t *work_queue_tail;+extern int done_adding_files;+extern pthread_cond_t files_ready;+extern pthread_mutex_t stats_mtx;+extern pthread_mutex_t work_queue_mtx; /* For symlink loop detection */@@ -64,7 +64,7 @@ typedef struct { UT_hash_handle hh; } symdir_t; -symdir_t *symhash;+extern symdir_t *symhash; ssize_t search_buf(const char *buf, const size_t buf_len, const char *dir_full_path);