Skip to content

Commit d67a994

Browse files
authored
fix order of Serialize for linux build (dotnet#17119)
Fix for #17116. The build would work fine for dynamic events on Windows, but on Linux clang always takes the overloads with <Head, Tail...> until there are no arguments, then complains about no overload takes 0 arguments.
1 parent 8f4a5e5 commit d67a994

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/gc/gcevent_serializers.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,33 +106,33 @@ struct EventSerializationTraits<uint32_t>
106106
* Given a list of arguments , returns the total size of
107107
* the buffer required to fully serialize the list of arguments.
108108
*/
109-
template<class Head, class... Tail>
110-
size_t SerializedSize(Head head, Tail... tail)
111-
{
112-
return EventSerializationTraits<Head>::SerializedSize(head) + SerializedSize(tail...);
113-
}
114-
115109
template<class Head>
116110
size_t SerializedSize(Head head)
117111
{
118112
return EventSerializationTraits<Head>::SerializedSize(head);
119113
}
120114

115+
template<class Head, class... Tail>
116+
size_t SerializedSize(Head head, Tail... tail)
117+
{
118+
return EventSerializationTraits<Head>::SerializedSize(head) + SerializedSize(tail...);
119+
}
120+
121121
/*
122122
* Given a list of arguments and a list of actual parameters, serialize
123123
* the arguments into the buffer that's given to us.
124124
*/
125-
template<class Head, class... Tail>
126-
void Serialize(uint8_t** buf, Head head, Tail... tail)
125+
template<class Head>
126+
void Serialize(uint8_t** buf, Head head)
127127
{
128128
EventSerializationTraits<Head>::Serialize(head, buf);
129-
Serialize(buf, tail...);
130129
}
131130

132-
template<class Head>
133-
void Serialize(uint8_t** buf, Head head)
131+
template<class Head, class... Tail>
132+
void Serialize(uint8_t** buf, Head head, Tail... tail)
134133
{
135134
EventSerializationTraits<Head>::Serialize(head, buf);
135+
Serialize(buf, tail...);
136136
}
137137

138138
} // namespace gc_event

0 commit comments

Comments
 (0)