diff options
author | Björn Gustavsson <[email protected]> | 2017-02-22 15:09:16 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-02-22 15:13:30 +0100 |
commit | c57a0b427c675c92d8d043dee48a3217b2e467ac (patch) | |
tree | d88235a7e8aa41a3b6371c64eb62258dd7999610 /lib/stdlib/src/c.erl | |
parent | d780cc676308f4315a293c2f0ec51dfd97e46a1d (diff) | |
download | otp-c57a0b427c675c92d8d043dee48a3217b2e467ac.tar.gz otp-c57a0b427c675c92d8d043dee48a3217b2e467ac.tar.bz2 otp-c57a0b427c675c92d8d043dee48a3217b2e467ac.zip |
c: Reintroduce support for non-list options in c/2
Before 0eb45e21d40 it was possible to write (for example):
c(m, dcore)
instead of the more verbose:
c(m, [dcore])
Reintroduce this convenient shortcut.
Diffstat (limited to 'lib/stdlib/src/c.erl')
-rw-r--r-- | lib/stdlib/src/c.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl index 38a36c168a..52df2319dd 100644 --- a/lib/stdlib/src/c.erl +++ b/lib/stdlib/src/c.erl @@ -83,9 +83,11 @@ c(Module) -> c(Module, []). -spec c(Module, Options) -> {'ok', ModuleName} | 'error' when Module :: file:name(), - Options :: [compile:option()], + Options :: [compile:option()] | compile:option(), ModuleName :: module(). +c(Module, SingleOption) when not is_list(SingleOption) -> + c(Module, [SingleOption]); c(Module, Opts) when is_atom(Module) -> %% either a module name or a source file name (possibly without %% suffix); if such a source file exists, it is used to compile from |