From: Neil Horman Date: Wed, 26 Jun 2024 15:51:51 +0000 (-0400) Subject: Augment version.c to not display -w options on non-windows X-Git-Tag: openssl-3.4.0-alpha1~388 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=290452f2bd7ba220a4a38a68371bfcd39765b1e9;p=thirdparty%2Fopenssl.git Augment version.c to not display -w options on non-windows Don't need the -w option on non-windows builds Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/24450) --- diff --git a/apps/version.c b/apps/version.c index bfcb1f15f97..4da8d274471 100644 --- a/apps/version.c +++ b/apps/version.c @@ -37,7 +37,9 @@ const OPTIONS version_options[] = { {"r", OPT_R, '-', "Show random seeding options"}, {"v", OPT_V, '-', "Show library version"}, {"c", OPT_C, '-', "Show CPU settings info"}, +#if defined(_WIN32) {"w", OPT_W, '-', "Show Windows install context"}, +#endif {NULL} }; @@ -45,7 +47,10 @@ int version_main(int argc, char **argv) { int ret = 1, dirty = 0, seed = 0; int cflags = 0, version = 0, date = 0, options = 0, platform = 0, dir = 0; - int engdir = 0, moddir = 0, cpuinfo = 0, windows = 0; + int engdir = 0, moddir = 0, cpuinfo = 0; +#if defined(_WIN32) + int windows = 0; +#endif char *prog; OPTION_CHOICE o; const char *tmp; @@ -92,9 +97,11 @@ opthelp: case OPT_C: dirty = cpuinfo = 1; break; - case OPT_W: - dirty = windows = 1; - break; +#if defined(_WIN32) + case OPT_W: + dirty = windows = 1; + break; +#endif case OPT_A: seed = options = cflags = version = date = platform = dir = engdir = moddir = cpuinfo @@ -142,8 +149,10 @@ opthelp: } if (cpuinfo) printf("%s\n", OpenSSL_version(OPENSSL_CPU_INFO)); +#if defined(_WIN32) if (windows) printf("OSSL_WINCTX: %s\n", OpenSSL_version(OPENSSL_WINCTX)); +#endif ret = 0; end: return ret;