diff options
author | Damjan Marion <damarion@cisco.com> | 2016-12-19 16:28:36 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-12-20 10:23:44 +0000 |
commit | 6a7acc2f9a551011b190e11910d8bfd09d8c74a4 (patch) | |
tree | e3460ba4f3954aa2fd0d2cb7c6f5a4870c970be8 /vlib | |
parent | fc6397307682b9874cd734d2bfcba9f6ef4820a9 (diff) |
Declare variables as external
non-external declarations in header files are generating
multiple empty definitions of the same symbol.
Change-Id: I7f3933404f79d08579468d0052c106731b57507c
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vlib')
-rw-r--r-- | vlib/vlib/buffer_funcs.h | 6 | ||||
-rw-r--r-- | vlib/vlib/main.c | 2 | ||||
-rw-r--r-- | vlib/vlib/main.h | 6 | ||||
-rw-r--r-- | vlib/vlib/threads.c | 1 | ||||
-rw-r--r-- | vlib/vlib/threads.h | 6 | ||||
-rw-r--r-- | vlib/vlib/unix/plugin.h | 2 | ||||
-rw-r--r-- | vlib/vlib/unix/unix.h | 2 |
7 files changed, 14 insertions, 11 deletions
diff --git a/vlib/vlib/buffer_funcs.h b/vlib/vlib/buffer_funcs.h index cfe568e32e9..75716eca7f6 100644 --- a/vlib/vlib/buffer_funcs.h +++ b/vlib/vlib/buffer_funcs.h @@ -676,9 +676,9 @@ vlib_buffer_init_two_for_free_list (vlib_buffer_t * _dst0, } #if CLIB_DEBUG > 0 -u32 *vlib_buffer_state_validation_lock; -uword *vlib_buffer_state_validation_hash; -void *vlib_buffer_state_heap; +extern u32 *vlib_buffer_state_validation_lock; +extern uword *vlib_buffer_state_validation_hash; +extern void *vlib_buffer_state_heap; #endif static inline void diff --git a/vlib/vlib/main.c b/vlib/vlib/main.c index fc294a72621..6c6cad98bba 100644 --- a/vlib/vlib/main.c +++ b/vlib/vlib/main.c @@ -50,6 +50,8 @@ CJ_GLOBAL_LOG_PROTOTYPE; speculative vector enqueues which overflow vector data in next frame. */ #define VLIB_FRAME_SIZE_ALLOC (VLIB_FRAME_SIZE + 4) +u32 wraps; + always_inline u32 vlib_frame_bytes (u32 n_scalar_bytes, u32 n_vector_bytes) { diff --git a/vlib/vlib/main.h b/vlib/vlib/main.h index 579ef09b255..d9ac1445ddd 100644 --- a/vlib/vlib/main.h +++ b/vlib/vlib/main.h @@ -176,7 +176,7 @@ typedef struct vlib_main_t } vlib_main_t; /* Global main structure. */ -vlib_main_t vlib_global_main; +extern vlib_main_t vlib_global_main; always_inline f64 vlib_time_now (vlib_main_t * vm) @@ -278,7 +278,7 @@ vlib_last_vector_length_per_node (vlib_main_t * vm) return n == 0 ? 0 : (f64) v / (f64) n; } -u32 wraps; +extern u32 wraps; always_inline void vlib_increment_main_loop_counter (vlib_main_t * vm) @@ -315,7 +315,7 @@ always_inline void vlib_set_queue_signal_callback int vlib_main (vlib_main_t * vm, unformat_input_t * input); /* Thread stacks, for os_get_cpu_number */ -u8 **vlib_thread_stacks; +extern u8 **vlib_thread_stacks; /* Number of thread stacks that the application needs */ u32 vlib_app_num_thread_stacks_needed (void) __attribute__ ((weak)); diff --git a/vlib/vlib/threads.c b/vlib/vlib/threads.c index fb84c676cb3..27b622f5137 100644 --- a/vlib/vlib/threads.c +++ b/vlib/vlib/threads.c @@ -51,6 +51,7 @@ vl (void *p) return vec_len (p); } +vlib_worker_thread_t *vlib_worker_threads; vlib_thread_main_t vlib_thread_main; uword diff --git a/vlib/vlib/threads.h b/vlib/vlib/threads.h index fd09c31181c..34ab5be8650 100644 --- a/vlib/vlib/threads.h +++ b/vlib/vlib/threads.h @@ -18,7 +18,7 @@ #include <vlib/main.h> #include <linux/sched.h> -vlib_main_t **vlib_mains; +extern vlib_main_t **vlib_mains; void vlib_set_thread_name (char *name); @@ -108,7 +108,7 @@ typedef struct pthread_t thread_id; } vlib_worker_thread_t; -vlib_worker_thread_t *vlib_worker_threads; +extern vlib_worker_thread_t *vlib_worker_threads; typedef struct { @@ -322,7 +322,7 @@ typedef struct } vlib_thread_main_t; -vlib_thread_main_t vlib_thread_main; +extern vlib_thread_main_t vlib_thread_main; #define VLIB_REGISTER_THREAD(x,...) \ __VA_ARGS__ vlib_thread_registration_t x; \ diff --git a/vlib/vlib/unix/plugin.h b/vlib/vlib/unix/plugin.h index e905263f232..c17053bd306 100644 --- a/vlib/vlib/unix/plugin.h +++ b/vlib/vlib/unix/plugin.h @@ -82,7 +82,7 @@ typedef struct vlib_main_t *vlib_main; } plugin_main_t; -plugin_main_t vlib_plugin_main; +extern plugin_main_t vlib_plugin_main; int vlib_plugin_early_init (vlib_main_t * vm); int vlib_load_new_plugins (plugin_main_t * pm, int from_early_init); diff --git a/vlib/vlib/unix/unix.h b/vlib/vlib/unix/unix.h index 69688a62b76..ea0d417b2b1 100644 --- a/vlib/vlib/unix/unix.h +++ b/vlib/vlib/unix/unix.h @@ -203,7 +203,7 @@ vlib_unix_get_main (void) } /* thread stack array; vec_len = max number of threads */ -u8 **vlib_thread_stacks; +extern u8 **vlib_thread_stacks; /* utils */ |