Skip to content

Commit

Permalink
Try to handle fallthrough on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiebeckley committed Jan 30, 2023
1 parent e8658cb commit 738033e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spirv_reflect.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
#include <stdlib.h>
#endif

#if defined(__clang__)
#define FALLTHROUGH __attribute__((fallthrough))
#else
#define FALLTHROUGH
#endif

#if defined(SPIRV_REFLECT_ENABLE_ASSERTS)
#define SPV_REFLECT_ASSERT(COND) \
assert(COND);
Expand Down Expand Up @@ -753,6 +759,7 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser)
case SpvOpTypeStruct:
{
p_node->member_count = p_node->word_count - 2;
FALLTHROUGH;
} // Fall through
case SpvOpTypeVoid:
case SpvOpTypeBool:
Expand Down Expand Up @@ -919,6 +926,7 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser)
CHECKED_READU32(p_parser, p_func_node->word_offset + 2, p_func_node->result_id);
++(p_parser->function_count);
}
FALLTHROUGH;
} // Fall through

case SpvOpFunctionEnd:
Expand Down

0 comments on commit 738033e

Please sign in to comment.