From: Russ Combs (rucombs) Date: Tue, 20 Dec 2016 13:57:19 +0000 (-0500) Subject: Merge pull request #758 in SNORT/snort3 from tsc_fix to master X-Git-Tag: 3.0.0-233~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acfe748babf0977a9d483964b43f8ac1a04d3de4;p=thirdparty%2Fsnort3.git Merge pull request #758 in SNORT/snort3 from tsc_fix to master Squashed commit of the following: commit 7752bae1299569b97989ed65f4867d64172620b5 Author: Russ Combs Date: Mon Dec 19 18:53:55 2016 -0500 do not build tsc clock scaling if not enabled (don't break non-x86 builds) --- diff --git a/src/time/clock_defs.h b/src/time/clock_defs.h index 23b1e60de..01881f6e8 100644 --- a/src/time/clock_defs.h +++ b/src/time/clock_defs.h @@ -32,7 +32,7 @@ using SnortClock = TscClock; #include using hr_clock = std::chrono::high_resolution_clock; using SnortClock = hr_clock; -inline long clock_scale() { return 1.0; } +inline long clock_scale() { return 1; } #endif using hr_duration = SnortClock::duration; diff --git a/src/time/tsc_clock.cc b/src/time/tsc_clock.cc index 9fcad2066..150d0158e 100644 --- a/src/time/tsc_clock.cc +++ b/src/time/tsc_clock.cc @@ -18,10 +18,18 @@ // tsc_clock.cc author Russ Combs #include "tsc_clock.h" + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include long clock_scale() { +#ifndef USE_TSC_CLOCK + return 1; +#else static long tpus = 0; // ticks / usec if ( !tpus ) @@ -33,5 +41,6 @@ long clock_scale() tpus = (long)((end - start)/1e6); } return tpus; +#endif }