From c4e4f79a2a2fd5530fa2677245f9361c7b04df70 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 25 Jul 2014 12:22:37 +0200 Subject: Disabled cover() for non-linux builds --- kernel/driver.cc | 2 +- kernel/log.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/driver.cc b/kernel/driver.cc index a4556fb1b..3c185e44b 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -749,7 +749,7 @@ int main(int argc, char **argv) delete yosys_design; yosys_design = NULL; -#ifndef NDEBUG +#ifdef COVER_ACTIVE if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE")) { char filename_buffer[4096]; diff --git a/kernel/log.h b/kernel/log.h index 18ea528a0..1658800dd 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -75,7 +75,8 @@ void log_cell(RTLIL::Cell *cell, std::string indent = ""); // This is the magic behind the code coverage counters // --------------------------------------------------- -#ifndef NDEBUG +#if defined(__linux__) && !defined(NDEBUG) +#define COVER_ACTIVE #define cover(_id) do { \ static CoverData __d __attribute__((section("yosys_cover_list"), aligned(1))) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \ -- cgit v1.2.3