From 9c3bcfa027cb32421ed20ab77553860b922b82fc Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Fri, 15 May 2015 13:50:38 -0400 Subject: Standardize handling of #ifdef'd options. Here are the "rules" for handling flags that depend on #ifdef: - Do not ifdef the enum. Only ifdef the OPTIONS table. All ifdef'd entries appear at the end; by convention "engine" is last. This ensures that at run-time, the flag will never be recognized/allowed. The next two bullets entries are for silencing compiler warnings: - In the while/switch parsing statement, use #ifdef for the body to disable it; leave the "case OPT_xxx:" and "break" statements outside the ifdef/ifndef. See ciphers.c for example. - If there are multiple options controlled by a single guard, OPT_FOO, OPT_BAR, etc., put a an #ifdef around the set, and then do "#else" and a series of case labels and a break. See OPENSSL_NO_AES in cms.c for example. Reviewed-by: Matt Caswell --- apps/dhparam.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/dhparam.c') diff --git a/apps/dhparam.c b/apps/dhparam.c index 931bf10226..2e5ce2c6d3 100644 --- a/apps/dhparam.c +++ b/apps/dhparam.c @@ -153,12 +153,12 @@ OPTIONS dhparam_options[] = { {"C", OPT_C, '-', "Print C code"}, {"2", OPT_2, '-', "Generate parameters using 2 as the generator value"}, {"5", OPT_5, '-', "Generate parameters using 5 as the generator value"}, -# ifndef OPENSSL_NO_ENGINE - {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"}, -# endif # ifndef OPENSSL_NO_DSA {"dsaparam", OPT_DSAPARAM, '-', "Read or generate DSA parameters, convert to DH"}, +# endif +# ifndef OPENSSL_NO_ENGINE + {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"}, # endif {NULL} }; -- cgit v1.2.3