From 57c418230038342ea147c9f2e6cd7350b5bf6e7e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 3 Jan 2025 01:29:31 +0100 Subject: [PATCH] Simplify kernel extension code setting up StructInitInfo --- src/digraphs.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/src/digraphs.c b/src/digraphs.c index b100f141e..996b26b9a 100644 --- a/src/digraphs.c +++ b/src/digraphs.c @@ -2274,34 +2274,13 @@ static Int InitLibrary(StructInitInfo* module) { *F InitInfopl() . . . . . . . . . . . . . . . . . table of init functions */ static StructInitInfo module = { -#ifdef DIGRAPHSSTATIC - .type = MODULE_STATIC, -#else - .type = MODULE_DYNAMIC, -#endif + .type = MODULE_DYNAMIC, .name = "digraphs", .initKernel = InitKernel, .initLibrary = InitLibrary, - .postRestore = 0}; - -#ifndef DIGRAPHSSTATIC -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wmissing-prototypes" -#elif defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#endif -StructInitInfo* Init__Dynamic(void) { - return &module; -} +}; -StructInitInfo* Init__digraphs(void) { +extern StructInitInfo* Init__Dynamic(void); // prototype to avoid warnings +StructInitInfo* Init__Dynamic(void) { return &module; } -#if defined(__clang__) -#pragma clang diagnostic pop -#elif defined(__GNUC__) -#pragma GCC diagnostic pop -#endif -#endif