mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +00:00
Fixed win32 troubles with f.readsome()
This commit is contained in:
parent
a32e067e5c
commit
8263f6a74a
6 changed files with 21 additions and 4 deletions
|
@ -166,6 +166,22 @@ bool patmatch(const char *pattern, const char *string)
|
|||
return false;
|
||||
}
|
||||
|
||||
int readsome(std::istream &f, char *s, int n)
|
||||
{
|
||||
int rc = f.readsome(s, n);
|
||||
|
||||
// win32 sometimes returns 0 on a non-empty stream..
|
||||
if (rc == 0) {
|
||||
int c = f.get();
|
||||
if (c != EOF) {
|
||||
*s = c;
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int GetSize(RTLIL::Wire *wire)
|
||||
{
|
||||
return wire->width;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue