diff --git a/examples/cycle.h b/examples/cycle.h index 2652a04adf7397efef405db0d0586f620bbcd058..e357a017c79a6e9befb73e2b988bd23918b66f37 100644 --- a/examples/cycle.h +++ b/examples/cycle.h @@ -171,7 +171,14 @@ INLINE_ELAPSED(__inline__) #if (defined(__GNUC__) || defined(__ICC)) && defined(__i386__) && !defined(HAVE_TICK_COUNTER) typedef unsigned long long ticks; -static __inline__ ticks getticks(void) +#ifndef INLINE +# if __GNUC__ && !__GNUC_STDC_INLINE__ +# define INLINE extern inline +# else +# define INLINE inline +# endif +#endif +INLINE ticks getticks(void) { ticks ret; @@ -220,7 +227,14 @@ static __inline double elapsed(ticks t1, ticks t0) #if (defined(__GNUC__) || defined(__ICC) || defined(__SUNPRO_C)) && defined(__x86_64__) && !defined(HAVE_TICK_COUNTER) typedef unsigned long long ticks; -static __inline__ ticks getticks(void) +#ifndef INLINE +# if __GNUC__ && !__GNUC_STDC_INLINE__ +# define INLINE extern inline +# else +# define INLINE inline +# endif +#endif +INLINE ticks getticks(void) { unsigned a, d; asm volatile("rdtsc" : "=a" (a), "=d" (d));