From c4c37b2069cc8f51965314ca27b8180046d1ea2b Mon Sep 17 00:00:00 2001 From: Ryan Lopopolo Date: Thu, 23 Jun 2022 21:38:55 -0700 Subject: [PATCH] Fix mismatched braces in `extern "C"` blocks when compiling as C++ When compiling mruby with `-DMRB_USE_CXX_EXCEPTION`, clang fails to compile and emits these warnings: vendor/mruby/src/vm.c:3066:1: error: extraneous closing brace ('}') } /* end of extern "C" */ ^ vendor/mruby/src/vm.c:3072:7: error: expected '}' #endif ^ vendor/mruby/src/vm.c:3070:12: note: to match this '{' extern "C" { ^ 2 errors generated. Fixup the implementation of the `extern "C"` block in `vm.c`. --- src/vm.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/vm.c b/src/vm.c index 831205f55..f6cf2baa1 100644 --- a/src/vm.c +++ b/src/vm.c @@ -27,9 +27,6 @@ extern "C" { #endif void abort(void); -#if defined(__cplusplus) -} /* extern "C" { */ -#endif #endif #define STACK_INIT_SIZE 128 @@ -3082,7 +3079,4 @@ mrb_top_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, mrb_int st } /* end of extern "C" */ # endif mrb_int mrb_jmpbuf::jmpbuf_id = 0; -# if !defined(MRB_USE_CXX_ABI) -extern "C" { -# endif #endif