summaryrefslogtreecommitdiff
path: root/kernel/driver.cc
diff options
context:
space:
mode:
authorSebastian Kuzminsky <seb@highlab.com>2016-05-14 15:44:13 +0200
committerRuben Undheim <ruben.undheim@gmail.com>2019-10-18 23:27:34 +0200
commitaaf35585cdbdc23215b3e88f5ed384ac923c1cb9 (patch)
tree22ed907f356bb26d3ed444178bafaf396e866b83 /kernel/driver.cc
parentc065995beac9e0abd83689db9a854d047f9e4899 (diff)
Change yosys to look for the #define constant "__unix__" instead of "__linux__", to select code appropriate for Unix-like systems. This has been tested with Clang 3.5 and GCC 4.6, 4.8, and 4.9 on Linux, and Clang 3.5 and GCC 4.9 on kFreeBSD.
Gbp-Pq: Name kfreebsd-support.patch
Diffstat (limited to 'kernel/driver.cc')
-rw-r--r--kernel/driver.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index f273057d..edec7760 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>
@@ -466,7 +466,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;
@@ -560,7 +560,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()) {
@@ -627,7 +627,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;