File 2341-c-Reintroduce-support-for-non-list-options-in-c-2.patch of Package erlang

From c57a0b427c675c92d8d043dee48a3217b2e467ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Wed, 22 Feb 2017 15:09:16 +0100
Subject: [PATCH 2/2] 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.
---
 lib/stdlib/src/c.erl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl
index 38a36c168..52df2319d 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
-- 
2.11.1

openSUSE Build Service is sponsored by