2
0
Эх сурвалжийг харах

benchmark: declare inline functions static to work with clang linker

- otherwise it results in no symbol found at module loading time
Daniel-Constantin Mierla 11 жил өмнө
parent
commit
452f322350

+ 1 - 1
modules/benchmark/benchmark.c

@@ -254,7 +254,7 @@ void reset_timers(void)
  *  1 - Timing enabled for all timers
  *  1 - Timing enabled for all timers
  */
  */
 
 
-inline int timer_active(unsigned int id)
+static inline int timer_active(unsigned int id)
 {
 {
 	if (bm_mycfg->enable_global > 0 || bm_mycfg->timers[id].enabled > 0)
 	if (bm_mycfg->enable_global > 0 || bm_mycfg->timers[id].enabled > 0)
 		return 1;
 		return 1;

+ 2 - 2
modules/benchmark/benchmark.h

@@ -69,7 +69,7 @@ typedef struct benchmark_timer
 	struct benchmark_timer *next;
 	struct benchmark_timer *next;
 } benchmark_timer_t;
 } benchmark_timer_t;
 
 
-inline int bm_get_time(bm_timeval_t *t)
+static inline int bm_get_time(bm_timeval_t *t)
 {
 {
 #ifdef BM_CLOCK_REALTIME
 #ifdef BM_CLOCK_REALTIME
 	if(clock_gettime(CLOCK_REALTIME, t)!=0)
 	if(clock_gettime(CLOCK_REALTIME, t)!=0)
@@ -84,7 +84,7 @@ inline int bm_get_time(bm_timeval_t *t)
 	return 0;
 	return 0;
 }
 }
 
 
-inline unsigned long long bm_diff_time(bm_timeval_t *t1, bm_timeval_t *t2)
+static inline unsigned long long bm_diff_time(bm_timeval_t *t1, bm_timeval_t *t2)
 {
 {
 	unsigned long long tdiff;
 	unsigned long long tdiff;