Ver código fonte

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 anos atrás
pai
commit
452f322350
2 arquivos alterados com 3 adições e 3 exclusões
  1. 1 1
      modules/benchmark/benchmark.c
  2. 2 2
      modules/benchmark/benchmark.h

+ 1 - 1
modules/benchmark/benchmark.c

@@ -254,7 +254,7 @@ void reset_timers(void)
  *  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)
 		return 1;

+ 2 - 2
modules/benchmark/benchmark.h

@@ -69,7 +69,7 @@ typedef struct benchmark_timer
 	struct benchmark_timer *next;
 } 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
 	if(clock_gettime(CLOCK_REALTIME, t)!=0)
@@ -84,7 +84,7 @@ inline int bm_get_time(bm_timeval_t *t)
 	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;