diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-10-15 01:12:53 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-10-15 01:12:53 +0200 |
commit | c3e9922b5d871269bf4ee33da24318d3b5199ac3 (patch) | |
tree | 74d252566f1ab890069e3e37b5b0a5776c5a5e4a /frontends/verilog | |
parent | cf85aab62f961c905e4691fde59af774053d3d58 (diff) | |
download | yosys-c3e9922b5d871269bf4ee33da24318d3b5199ac3.tar.gz yosys-c3e9922b5d871269bf4ee33da24318d3b5199ac3.tar.bz2 yosys-c3e9922b5d871269bf4ee33da24318d3b5199ac3.zip |
Replaced readsome() with read() and gcount()
Diffstat (limited to 'frontends/verilog')
-rw-r--r-- | frontends/verilog/preproc.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/frontends/verilog/preproc.cc b/frontends/verilog/preproc.cc index b4e77c31b..da658410d 100644 --- a/frontends/verilog/preproc.cc +++ b/frontends/verilog/preproc.cc @@ -196,14 +196,16 @@ static std::string next_token(bool pass_newline = false) static void input_file(std::istream &f, std::string filename) { char buffer[513]; - int rc; insert_input(""); auto it = input_buffer.begin(); input_buffer.insert(it, "`file_push " + filename + "\n"); - while ((rc = readsome(f, buffer, sizeof(buffer)-1)) > 0) { - buffer[rc] = 0; + while (1) { + f.read(buffer, sizeof(buffer)-1); + if (f.gcount() <= 0) + break; + buffer[f.gcount()] = 0; input_buffer.insert(it, buffer); } input_buffer.insert(it, "\n`file_pop\n"); |