Skip to content

Commit c61b2bc

Browse files
Merge pull request #4794 from YosysHQ/krys/cygwin_compat
Fix Cygwin compatibility
2 parents c96d02b + 7d8140d commit c61b2bc

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

kernel/mem.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,8 +1680,6 @@ SigSpec MemWr::decompress_en(const std::vector<int> &swizzle, SigSpec sig) {
16801680
return res;
16811681
}
16821682

1683-
using addr_t = MemContents::addr_t;
1684-
16851683
MemContents::MemContents(Mem *mem) :
16861684
MemContents(ceil_log2(mem->size), mem->width)
16871685
{
@@ -1758,7 +1756,7 @@ bool MemContents::_range_overlaps(std::map<addr_t, RTLIL::Const>::iterator it, a
17581756
return !(top1 < begin_addr || top2 < _range_begin(it));
17591757
}
17601758

1761-
std::map<addr_t, RTLIL::Const>::iterator MemContents::_range_at(addr_t addr) const {
1759+
std::map<MemContents::addr_t, RTLIL::Const>::iterator MemContents::_range_at(addr_t addr) const {
17621760
// allow addr == 1<<_addr_width (which will just return end())
17631761
log_assert(addr <= (addr_t)(1<<_addr_width));
17641762
// get the first range with base > addr
@@ -1786,7 +1784,7 @@ RTLIL::Const MemContents::operator[](addr_t addr) const {
17861784
return _default_value;
17871785
}
17881786

1789-
addr_t MemContents::count_range(addr_t begin_addr, addr_t end_addr) const {
1787+
MemContents::addr_t MemContents::count_range(addr_t begin_addr, addr_t end_addr) const {
17901788
addr_t count = 0;
17911789
for(auto it = _range_at(begin_addr); _range_overlaps(it, begin_addr, end_addr); it++) {
17921790
auto first = std::max(_range_begin(it), begin_addr);
@@ -1829,7 +1827,7 @@ void MemContents::clear_range(addr_t begin_addr, addr_t end_addr) {
18291827
_values.erase(begin_it, end_it);
18301828
}
18311829

1832-
std::map<addr_t, RTLIL::Const>::iterator MemContents::_reserve_range(addr_t begin_addr, addr_t end_addr) {
1830+
std::map<MemContents::addr_t, RTLIL::Const>::iterator MemContents::_reserve_range(addr_t begin_addr, addr_t end_addr) {
18331831
if(begin_addr >= end_addr)
18341832
return _values.end(); // need a dummy value to return, end() is cheap
18351833
// find the first range containing any addr >= begin_addr - 1

libs/fst/00_PATCH_win_io.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* mmap compatibility
4444
*/
4545
-#if defined __MINGW32__
46-
+#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER
46+
+#if defined __MINGW32__ || defined _MSC_VER
4747
#include <limits.h>
4848
#define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off))
4949
#define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr)

libs/fst/fstapi.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ return(NULL);
341341
/*
342342
* mmap compatibility
343343
*/
344-
#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER
344+
#if defined __MINGW32__ || defined _MSC_VER
345345
#include <limits.h>
346346
#define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off))
347347
#define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr)

0 commit comments

Comments
 (0)