diff options
Diffstat (limited to 'Src/module.c')
-rw-r--r-- | Src/module.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Src/module.c b/Src/module.c index 8f5afca83..a6329850e 100644 --- a/Src/module.c +++ b/Src/module.c @@ -389,7 +389,7 @@ getconddef(int inf, char *name, int autol) /* This is a definition for an autoloaded condition, load the * * module if we haven't tried that already. */ if (f) { - (void)load_module_silence(p->module, NULL, 0); + (void)ensurefeature(p->module, "c:", name); f = 0; p = NULL; } else { @@ -907,7 +907,7 @@ getmathfunc(char *name, int autol) removemathfunc(q, p); - (void)load_module_silence(n, NULL, 0); + (void)ensurefeature(n, "f:", name); return getmathfunc(name, 0); } @@ -2850,7 +2850,7 @@ setfeatureenables(char const *nam, Features f, int *e) ret = 1; return ret; } - + /**/ mod_export int handlefeatures(char *nam, Features f, int **enables) @@ -2860,3 +2860,20 @@ handlefeatures(char *nam, Features f, int **enables) *enables = getfeatureenables(nam, f); return 0; } + +/* + * Ensure module "modname" is providing feature with "prefix" + * and "feature" (e.g. "b:", "limit"). + */ + +/**/ +mod_export int +ensurefeature(char *modname, char *prefix, char *feature) +{ + char *f = dyncat(prefix, feature); + char *features[2]; + + features[0] = f; + features[1] = NULL; + return require_module(NULL, modname, features); +} |