projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
665a967
)
Modified $readmem[hb] to use '\' or '/' according the OS
author
Rodrigo Alejandro Melo
<rmelo@inti.gob.ar>
Thu, 6 Feb 2020 13:10:29 +0000
(10:10 -0300)
committer
Rodrigo Alejandro Melo
<rmelo@inti.gob.ar>
Thu, 6 Feb 2020 13:10:29 +0000
(10:10 -0300)
Signed-off-by: Rodrigo Alejandro Melo <rmelo@inti.gob.ar>
frontends/ast/simplify.cc
patch
|
blob
|
history
diff --git
a/frontends/ast/simplify.cc
b/frontends/ast/simplify.cc
index 52f157c6e8ad8f3cf5786684db44e27a43da130c..fe0412699b1d33b97f759b021d03d452da4cc147 100644
(file)
--- a/
frontends/ast/simplify.cc
+++ b/
frontends/ast/simplify.cc
@@
-2904,7
+2904,12
@@
AstNode *AstNode::readmem(bool is_readmemh, std::string mem_filename, AstNode *m
std::ifstream f;
f.open(mem_filename.c_str());
if (f.fail()) {
- std::string path = filename.substr(0, filename.find_last_of("\\/")+1);
+#ifdef _WIN32
+ char slash = '\\';
+#else
+ char slash = '/';
+#endif
+ std::string path = filename.substr(0, filename.find_last_of(slash)+1);
f.open(path + mem_filename.c_str());
yosys_input_files.insert(path + mem_filename);
} else {