]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #758 in SNORT/snort3 from tsc_fix to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 20 Dec 2016 13:57:19 +0000 (08:57 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 20 Dec 2016 13:57:19 +0000 (08:57 -0500)
Squashed commit of the following:

commit 7752bae1299569b97989ed65f4867d64172620b5
Author: Russ Combs <rucombs@cisco.com>
Date:   Mon Dec 19 18:53:55 2016 -0500

    do not build tsc clock scaling if not enabled
        (don't break non-x86 builds)

src/time/clock_defs.h
src/time/tsc_clock.cc

index 23b1e60de33e1d8ac0d3c6794833851055c4c41f..01881f6e874f78dadfd9b55269344a3d529eeb4f 100644 (file)
@@ -32,7 +32,7 @@ using SnortClock = TscClock;
 #include <chrono>
 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;
index 9fcad2066d29203c8de3dde00bea4156be080172..150d0158e90fbe2be1d0c67cb9abc47a04a18a2d 100644 (file)
 // tsc_clock.cc author Russ Combs <rucombs@cisco.com>
 
 #include "tsc_clock.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <time.h>
 
 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
 }