aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-03-11 14:24:24 +0100
committerClifford Wolf <clifford@clifford.at>2014-03-11 14:24:24 +0100
commit91704a78531bec2e3eea3ddf90eaedb28e1d696d (patch)
treea3817eb12cebb9e9adc0f2375eda59ddb2d9004a /passes
parent9992026a8d4482abd8fbae8cb246a87cbbbde364 (diff)
downloadyosys-91704a78531bec2e3eea3ddf90eaedb28e1d696d.tar.gz
yosys-91704a78531bec2e3eea3ddf90eaedb28e1d696d.tar.bz2
yosys-91704a78531bec2e3eea3ddf90eaedb28e1d696d.zip
Merged a few fixes for non-posix systems from github.com/Siesh1oo/yosys
(see https://github.com/cliffordwolf/yosys/pull/28)
Diffstat (limited to 'passes')
-rw-r--r--passes/abc/abc.cc9
-rw-r--r--passes/cmds/select.cc1
-rw-r--r--passes/fsm/fsm_recode.cc3
-rw-r--r--passes/techmap/dfflibmap.cc1
4 files changed, 11 insertions, 3 deletions
diff --git a/passes/abc/abc.cc b/passes/abc/abc.cc
index 2829e660f..286b750cc 100644
--- a/passes/abc/abc.cc
+++ b/passes/abc/abc.cc
@@ -43,7 +43,9 @@
#include <stdio.h>
#include <string.h>
#include <dirent.h>
+#include <cerrno>
#include <sstream>
+#include <climits>
#include "blifparse.h"
@@ -973,7 +975,11 @@ struct AbcPass : public Pass {
int lut_mode = 0;
size_t argidx;
- char *pwd = get_current_dir_name();
+ char pwd [PATH_MAX];
+ if (!getcwd(pwd, sizeof(pwd))) {
+ log_cmd_error("getcwd failed: %s\n", strerror(errno));
+ log_abort();
+ }
for (argidx = 1; argidx < args.size(); argidx++) {
std::string arg = args[argidx];
if (arg == "-exe" && argidx+1 < args.size()) {
@@ -1020,7 +1026,6 @@ struct AbcPass : public Pass {
}
break;
}
- free(pwd);
extra_args(args, argidx, design);
if (lut_mode != 0 && !liberty_file.empty())
diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc
index 3a886b1c8..59f936b01 100644
--- a/passes/cmds/select.cc
+++ b/passes/cmds/select.cc
@@ -23,6 +23,7 @@
#include "kernel/log.h"
#include <string.h>
#include <fnmatch.h>
+#include <errno.h>
using RTLIL::id2cstr;
diff --git a/passes/fsm/fsm_recode.cc b/passes/fsm/fsm_recode.cc
index 5a4e091cf..b02287962 100644
--- a/passes/fsm/fsm_recode.cc
+++ b/passes/fsm/fsm_recode.cc
@@ -23,8 +23,9 @@
#include "kernel/consteval.h"
#include "kernel/celltypes.h"
#include "fsmdata.h"
-#include "math.h"
+#include <math.h>
#include <string.h>
+#include <errno.h>
static void fm_set_fsm_print(RTLIL::Cell *cell, RTLIL::Module *module, FsmData &fsm_data, const char *prefix, FILE *f)
{
diff --git a/passes/techmap/dfflibmap.cc b/passes/techmap/dfflibmap.cc
index fd5fa86e1..4bf73358b 100644
--- a/passes/techmap/dfflibmap.cc
+++ b/passes/techmap/dfflibmap.cc
@@ -21,6 +21,7 @@
#include "kernel/log.h"
#include "libparse.h"
#include <string.h>
+#include <errno.h>
using namespace PASS_DFFLIBMAP;