Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit c4ff3d8

Browse files
committed
Fix typo + remove duplicate rt_configOption declaration
1 parent 6121d40 commit c4ff3d8

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/core/internal/parseoptions.d

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import core.stdc.stdio;
1414
import core.stdc.ctype;
1515
import core.stdc.string;
1616
import core.vararg;
17+
import core.internal.traits : externDFunc;
18+
1719

1820
@nogc nothrow:
1921
extern extern(C) string[] rt_args();
@@ -22,6 +24,10 @@ extern extern(C) __gshared bool rt_envvars_enabled;
2224
extern extern(C) __gshared bool rt_cmdline_enabled;
2325
extern extern(C) __gshared string[] rt_options;
2426

27+
alias rt_configCallBack = string delegate(string) @nogc nothrow;
28+
alias fn_configOption = string function(string opt, scope rt_configCallBack dg, bool reverse) @nogc nothrow;
29+
alias rt_configOption = externDFunc!("rt.config.rt_configOption", fn_configOption);
30+
2531
/**
2632
* initialize members of struct CFG from rt_config options
2733
*
@@ -32,13 +38,6 @@ extern extern(C) __gshared string[] rt_options;
3238
*/
3339
bool initConfigOptions(CFG)(ref CFG cfg, string cfgname)
3440
{
35-
import core.internal.traits : externDFunc;
36-
37-
alias rt_configCallBack = string delegate(string) @nogc nothrow;
38-
alias fn_configOption = string function(string opt, scope rt_configCallBack dg, bool reverse) @nogc nothrow;
39-
40-
alias rt_configOption = externDFunc!("rt.config.rt_configOption", fn_configOption);
41-
4241
string parse(string opt) @nogc nothrow
4342
{
4443
if (!parseOptions(cfg, opt))

src/core/runtime.d

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,10 +655,7 @@ extern (C) UnitTestResult runModuleUnitTests()
655655
}
656656
}
657657

658-
import core.internal.traits : externDFunc;
659-
alias rt_configCallBack = string delegate(string) @nogc nothrow;
660-
alias fn_configOption = string function(string opt, scope rt_configCallBack dg, bool reverse) @nogc nothrow;
661-
alias rt_configOption = externDFunc!("rt.config.rt_configOption", fn_configOption);
658+
import core.internal.parseoptions : rt_configOption;
662659

663660
if (results.passed != results.executed)
664661
{

src/rt/config.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ alias rt_configCallBack = string delegate(string) @nogc nothrow;
6060

6161
/**
6262
* get a druntime config option using standard configuration options
63-
* opt name of the option to retreive
63+
* opt name of the option to retrieve
6464
* dg if non-null, passes the option through this
6565
* delegate and only returns its return value if non-null
6666
* reverse reverse the default processing order cmdline/envvar/rt_options

0 commit comments

Comments
 (0)