From 69f34b359c0ec0d4517050fe274883421c4c119b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 3 Aug 2025 16:09:42 +0100 Subject: Tidy up some extensions and remove some ifdefs Since this codebase is already extremely nonportable, I've decided to relax the obsessive ifdef-else-error usage around all the extensions. From now on, if there's no alternative to using an extension, we can just use that extension. If it's possible to do something in a relatively portable way, we can still try to do that in order to make the code somewhat reusable, in contexts where that makes sense. I also decided to use langext.h for naked functions and tail calls. If that's used in another codebase build with a different compiler, those just won't work, but that's fine. The benefit is really just that there's less ceremony in places where those are used, because it's likely there'll be a few more such places in the future, and it gets annoying reading all the double-underscore stuff all over the place. I still kind of want to do something about all the _WIN32 ifdefs too, but I've realised that doing so will lead to almost nothing actually being built on Linux. Then again, none of it currently runs on Linux so I guess that's a moot point. Will worry about it later, anyway. --- src/sst.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/sst.c') diff --git a/src/sst.c b/src/sst.c index 25e396c..7fd0275 100644 --- a/src/sst.c +++ b/src/sst.c @@ -504,15 +504,7 @@ static void hook_plugin_unload_cbv2(const struct con_cmdargs *args) { case UNLOAD_SKIP: return; case UNLOAD_SELF: -#ifdef __clang__ - // thanks clang for forcing use of return here and ALSO warning! -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpedantic" - __attribute((musttail)) return orig_plugin_unload_cb.v2(args); -#pragma clang diagnostic pop -#else -#error We are tied to clang without an assembly solution for this! -#endif + tailcall orig_plugin_unload_cb.v2(args); case UNLOAD_OTHER: orig_plugin_unload_cb.v2(args); EMIT_PluginUnloaded(); -- cgit v1.2.3-54-g00ecf