]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
crypto: fix preprocessor concatenation
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>
Mon, 27 Jan 2025 07:36:07 +0000 (08:36 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 31 Mar 2025 11:58:06 +0000 (13:58 +0200)
String litteral don't need the '##' operator, which causes build
failures:
crypto/defaults.c:kepi:23: error: pasting ""SOFTWARE\\WOW6432Node\\OpenSSL"" and ""-"" does not give a valid preprocessing token

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

crypto/cversion.c
crypto/defaults.c

index 87154645b0f05c581671b6ef80fd65f3aae16d01..ae439c668b3482b087cd7fb537e96b4a34555dd8 100644 (file)
@@ -72,7 +72,7 @@ DEFINE_RUN_ONCE_STATIC(version_strings_setup)
 }
 
 # define TOSTR(x) #x
-# define OSSL_WINCTX_STRING "OSSL_WINCTX: \"" ## TOSTR(OSSL_WINCTX) ## "\""
+# define OSSL_WINCTX_STRING "OSSL_WINCTX: \"" TOSTR(OSSL_WINCTX) "\""
 
 #endif
 
index 908539cf31cfeef370ba85d6756ae88a85b15e2a..b507660d4214469d9e7231f6e2296111d36d0331 100644 (file)
@@ -19,7 +19,7 @@
 # define MAKESTR(x) TOSTR(x)
 # define NOQUOTE(x) x
 # if defined(OSSL_WINCTX)
-# define REGISTRY_KEY "SOFTWARE\\WOW6432Node\\OpenSSL" ##"-"## MAKESTR(OPENSSL_VERSION_MAJOR) ##"."## MAKESTR(OPENSSL_VERSION_MINOR) ##"-"## MAKESTR(OSSL_WINCTX)
+#  define REGISTRY_KEY "SOFTWARE\\WOW6432Node\\OpenSSL" "-" MAKESTR(OPENSSL_VERSION_MAJOR) "." MAKESTR(OPENSSL_VERSION_MINOR) "-" MAKESTR(OSSL_WINCTX)
 # endif
 
 /**
@@ -70,7 +70,7 @@ static char *get_windows_regdirs(char *dst, LPCTSTR valuename)
     LSTATUS ret;
     DWORD index = 0;
     LPCTCH tempstr = NULL;
-   
+
     ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
                        TEXT(REGISTRY_KEY), KEY_WOW64_32KEY,
                        KEY_QUERY_VALUE, &hkey);
@@ -97,7 +97,7 @@ static char *get_windows_regdirs(char *dst, LPCTSTR valuename)
         goto out;
 
     if (!WideCharToMultiByte(CP_UTF8, 0, tempstr, -1, dst, keysize,
-                             NULL, NULL)) 
+                             NULL, NULL))
         goto out;
 
     retval = dst;