]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Augment version.c to not display -w options on non-windows
authorNeil Horman <nhorman@openssl.org>
Wed, 26 Jun 2024 15:51:51 +0000 (11:51 -0400)
committerNeil Horman <nhorman@openssl.org>
Tue, 9 Jul 2024 08:01:44 +0000 (04:01 -0400)
Don't need the -w option on non-windows builds

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24450)

apps/version.c

index bfcb1f15f97c641e2024243c12e35e949d9d3176..4da8d2744717a70a1b149271606f55ab7ad734ce 100644 (file)
@@ -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;