summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/driver.cc8
-rw-r--r--kernel/log.cc6
-rw-r--r--kernel/log.h2
-rw-r--r--kernel/yosys.cc4
4 files changed, 10 insertions, 10 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index 17864110..8b328e5b 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -34,7 +34,7 @@
#include <limits.h>
#include <errno.h>
-#if defined (__linux__) || defined(__FreeBSD__)
+#if defined (__unix__) || defined(__FreeBSD__)
# include <sys/resource.h>
# include <sys/types.h>
# include <unistd.h>
@@ -449,7 +449,7 @@ int main(int argc, char **argv)
if (print_stats)
log_hasher = new SHA1;
-#if defined(__linux__)
+#if defined(__unix__)
// set stack size to >= 128 MB
{
struct rlimit rl;
@@ -532,7 +532,7 @@ int main(int argc, char **argv)
#else
std::string meminfo;
std::string stats_divider = ", ";
-# if defined(__linux__)
+# if defined(__unix__)
std::ifstream statm;
statm.open(stringf("/proc/%lld/statm", (long long)getpid()));
if (statm.is_open()) {
@@ -599,7 +599,7 @@ int main(int argc, char **argv)
}
}
-#if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__))
+#if defined(YOSYS_ENABLE_COVER) && (defined(__unix__) || defined(__FreeBSD__))
if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE"))
{
string filename;
diff --git a/kernel/log.cc b/kernel/log.cc
index 0ee2170a..1dfa89a4 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -25,7 +25,7 @@
# include <sys/time.h>
#endif
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__unix__) || defined(__FreeBSD__)
# include <dlfcn.h>
#endif
@@ -389,7 +389,7 @@ void log_pop()
log_flush();
}
-#if (defined(__linux__) || defined(__FreeBSD__)) && defined(YOSYS_ENABLE_PLUGINS)
+#if (defined(__unix__) || defined(__FreeBSD__)) && defined(YOSYS_ENABLE_PLUGINS)
void log_backtrace(const char *prefix, int levels)
{
if (levels <= 0) return;
@@ -584,7 +584,7 @@ void log_wire(RTLIL::Wire *wire, std::string indent)
// ---------------------------------------------------
// This is the magic behind the code coverage counters
// ---------------------------------------------------
-#if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__))
+#if defined(YOSYS_ENABLE_COVER) && (defined(__unix__) || defined(__FreeBSD__))
dict<std::string, std::pair<std::string, int>> extra_coverage_data;
diff --git a/kernel/log.h b/kernel/log.h
index 0b4905c3..0f068a16 100644
--- a/kernel/log.h
+++ b/kernel/log.h
@@ -119,7 +119,7 @@ static inline void log_assert_worker(bool cond, const char *expr, const char *fi
// This is the magic behind the code coverage counters
// ---------------------------------------------------
-#if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__))
+#if defined(YOSYS_ENABLE_COVER) && (defined(__unix__) || defined(__FreeBSD__))
#define cover(_id) do { \
static CoverData __d __attribute__((section("yosys_cover_list"), aligned(1), used)) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \
diff --git a/kernel/yosys.cc b/kernel/yosys.cc
index ad032899..822cab93 100644
--- a/kernel/yosys.cc
+++ b/kernel/yosys.cc
@@ -77,7 +77,7 @@ std::vector<void*> memhasher_store;
void memhasher_on()
{
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__unix__) || defined(__FreeBSD__)
memhasher_rng += time(NULL) << 16 ^ getpid();
#endif
memhasher_store.resize(0x10000);
@@ -660,7 +660,7 @@ struct TclPass : public Pass {
} TclPass;
#endif
-#if defined(__linux__) || defined(__CYGWIN__)
+#if defined(__unix__)
std::string proc_self_dirname()
{
char path[PATH_MAX];