Skip to content

Commit 4114849

Browse files
committed
Fixes for MSVC
Provide rr_graph_utils with full definition of lambda function. Remove/replace __attribute since MSVC doesn't know about it.
1 parent 3e53a93 commit 4114849

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

libs/librrgraph/src/base/rr_graph_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ vtr::vector<RRNodeId, std::vector<RREdgeId>> get_fan_in_list(const RRGraphView&
139139

140140
//Walk the graph and increment fanin on all dwnstream nodes
141141
rr_graph.rr_nodes().for_each_edge(
142-
[&](RREdgeId edge, __attribute__((unused)) RRNodeId src, RRNodeId sink) {
142+
[&](RREdgeId edge, RRNodeId src, RRNodeId sink) -> void {
143143
node_fan_in_list[sink].push_back(edge);
144144
});
145145

@@ -258,4 +258,4 @@ bool inter_layer_connections_limited_to_opin(const RRGraphView& rr_graph) {
258258
}
259259

260260
return limited_to_opin;
261-
}
261+
}

libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,15 @@ inline void write_rr_graph_xml(T &in, Context &context, std::ostream &os){
202202
}
203203

204204

205+
#if defined(_MSC_VER)
206+
typedef const uint32_t __declspec(align(1)) triehash_uu32;
207+
typedef const uint64_t __declspec(align(1)) triehash_uu64;
208+
#else
205209
typedef const uint32_t __attribute__((aligned(1))) triehash_uu32;
206210
typedef const uint64_t __attribute__((aligned(1))) triehash_uu64;
207211
static_assert(alignof(triehash_uu32) == 1, "Unaligned 32-bit access not found.");
208212
static_assert(alignof(triehash_uu64) == 1, "Unaligned 64-bit access not found.");
213+
#endif
209214
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
210215
#define onechar(c, s, l) (((uint64_t)(c)) << (s))
211216
#else

0 commit comments

Comments
 (0)