1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

do not include tsc.h on non x86 archs (closes #211)

This commit is contained in:
Steffen Vogel 2018-11-14 17:08:23 +01:00
parent b1eb89be02
commit b4e467d634
3 changed files with 9 additions and 5 deletions

View file

@ -27,7 +27,6 @@
#include <stdint.h>
#include <time.h>
#include <villas/tsc.h>
#ifdef __cplusplus
extern "C" {
@ -48,6 +47,10 @@ extern "C" {
#error "Platform not supported"
#endif
#if PERIODIC_TASK_IMPL == RDTSC
#include <villas/tsc.h>
#endif
struct task {
int clock; /**< CLOCK_{MONOTONIC,REALTIME} */
@ -62,7 +65,7 @@ struct task {
#if PERIODIC_TASK_IMPL == TIMERFD
int fd; /**< The timerfd_create(2) file descriptior. */
#elif PERIODIC_TASK_IMPL == RDTSC
struct tsc tsc; /**< Initialized by tsc_init(). */
struct tsc tsc; /**< Initialized by tsc_init(). */
#endif
};

View file

@ -30,8 +30,6 @@
#if PERIODIC_TASK_IMPL == TIMERFD
#include <sys/timerfd.h>
#elif PERIODIC_TASK_IMPL == RDTSC
#include <villas/tsc.h>
#endif
int task_init(struct task *t, double rate, int clock)

View file

@ -41,10 +41,13 @@ if(CRITERION_FOUND)
task.c
timing.c
utils.c
tsc.c
hash_table.c
)
if(ARCH STREQUAL "x86_64")
list(APPEND TEST_SRC tsc.c)
endif()
add_executable(unit-tests ${TEST_SRC})
target_link_libraries(unit-tests PUBLIC
PkgConfig::CRITERION