Skip to content

Commit 57c4182

Browse files
fingolfinjames-d-mitchell
authored andcommitted
Simplify kernel extension code setting up StructInitInfo
1 parent 521f28b commit 57c4182

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

src/digraphs.c

+4-25
Original file line numberDiff line numberDiff line change
@@ -2274,34 +2274,13 @@ static Int InitLibrary(StructInitInfo* module) {
22742274
*F InitInfopl() . . . . . . . . . . . . . . . . . table of init functions
22752275
*/
22762276
static StructInitInfo module = {
2277-
#ifdef DIGRAPHSSTATIC
2278-
.type = MODULE_STATIC,
2279-
#else
2280-
.type = MODULE_DYNAMIC,
2281-
#endif
2277+
.type = MODULE_DYNAMIC,
22822278
.name = "digraphs",
22832279
.initKernel = InitKernel,
22842280
.initLibrary = InitLibrary,
2285-
.postRestore = 0};
2286-
2287-
#ifndef DIGRAPHSSTATIC
2288-
#if defined(__clang__)
2289-
#pragma clang diagnostic push
2290-
#pragma clang diagnostic ignored "-Wmissing-prototypes"
2291-
#elif defined(__GNUC__)
2292-
#pragma GCC diagnostic push
2293-
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
2294-
#endif
2295-
StructInitInfo* Init__Dynamic(void) {
2296-
return &module;
2297-
}
2281+
};
22982282

2299-
StructInitInfo* Init__digraphs(void) {
2283+
extern StructInitInfo* Init__Dynamic(void); // prototype to avoid warnings
2284+
StructInitInfo* Init__Dynamic(void) {
23002285
return &module;
23012286
}
2302-
#if defined(__clang__)
2303-
#pragma clang diagnostic pop
2304-
#elif defined(__GNUC__)
2305-
#pragma GCC diagnostic pop
2306-
#endif
2307-
#endif

0 commit comments

Comments
 (0)