Skip to content

Commit 641e4c9

Browse files
committed
UCP/PROTO: Fixed build
1 parent e0a8fa4 commit 641e4c9

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/ucp/proto/proto_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ typedef struct {
189189
* variant, which is used to print the variant name.
190190
*/
191191
#define UCP_FOREACH_PROTO_VARIANT(_macro) \
192-
_macro(UCP_PROTO_VARIANT_LAT, UCS_KBYTE, "lat") \
193-
_macro(UCP_PROTO_VARIANT_BW, UCS_GBYTE, "bw")
192+
_macro(UCP_PROTO_VARIANT_BW, UCS_GBYTE, "bw") \
193+
_macro(UCP_PROTO_VARIANT_LAT, UCS_KBYTE, "lat")
194194

195195
/**
196196
* Protocol selection variant enum

src/ucp/proto/proto_common.inl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,10 @@ ucp_proto_common_get_variant_msg_size(ucp_proto_variant_t variant)
413413
#define UCP_PROTO_VARIANT_IT(ID, MSG_SIZE, _) case ID: return MSG_SIZE;
414414
switch (variant) {
415415
UCP_FOREACH_PROTO_VARIANT(UCP_PROTO_VARIANT_IT)
416-
default: ucs_assert_always(0);
417416
}
418417
#undef UCP_PROTO_VARIANT_IT
418+
ucs_fatal("unexpected variant %d", variant);
419+
return 0;
419420
}
420421

421422
static UCS_F_ALWAYS_INLINE const char*
@@ -424,9 +425,16 @@ ucp_proto_common_get_variant_name(ucp_proto_variant_t variant)
424425
#define UCP_PROTO_VARIANT_IT(ID, _, NAME) case ID: return NAME;
425426
switch (variant) {
426427
UCP_FOREACH_PROTO_VARIANT(UCP_PROTO_VARIANT_IT)
427-
default: ucs_assert_always(0);
428428
}
429429
#undef UCP_PROTO_VARIANT_IT
430+
ucs_fatal("unexpected variant %d", variant);
431+
return NULL;
432+
}
433+
434+
static UCS_F_ALWAYS_INLINE size_t
435+
ucp_proto_common_get_variants_count(ucp_context_h context)
436+
{
437+
return context->config.ext.proto_variants_enable ? UCP_PROTO_VARIANT_LAST : 1;
430438
}
431439

432440
#endif

0 commit comments

Comments
 (0)