rust/tests/run-make/c-unwind-abi-catch-lib-panic/add.c
2023-03-30 07:34:55 -05:00

13 lines
263 B
C

#ifdef _WIN32
__declspec(dllexport)
#endif
// An external function, defined in Rust.
extern void panic_if_greater_than_10(unsigned x);
unsigned add_small_numbers(unsigned a, unsigned b) {
unsigned c = a + b;
panic_if_greater_than_10(c);
return c;
}