crypto/dso/dso_vms.c: Better definition of DSO_MALLOC()
authorRichard Levitte <levitte@openssl.org>
Fri, 28 Oct 2022 10:11:30 +0000 (12:11 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 28 Oct 2022 10:11:30 +0000 (12:11 +0200)
Now we cover all possible cases.

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

crypto/dso/dso_vms.c

index 236b1924d401d0ddce4fbde9c841700e618092de..6c84bb198828c62e7a65446fbb021f1835152324 100644 (file)
@@ -22,6 +22,7 @@
 # include "../vms_rms.h"
 
 /* Some compiler options may mask the declaration of "_malloc32". */
+# define DSO_MALLOC OPENSSL_malloc
 # if __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE
 #  if __INITIAL_POINTER_SIZE == 64
 #   pragma pointer_size save
@@ -37,10 +38,9 @@ static void *dso_malloc(__size_t num, const char *file, int line)
     }
     return ret;
 }
+#   undef DSO_MALLOC
 #   define DSO_MALLOC(num) dso_malloc((num), OPENSSL_FILE, OPENSSL_LINE)
 #   pragma pointer_size restore
-#  else                         /* __INITIAL_POINTER_SIZE == 64 */
-#   define DSO_MALLOC OPENSSL_malloc
 #  endif                        /* __INITIAL_POINTER_SIZE == 64 [else] */
 # endif                         /* __INITIAL_POINTER_SIZE && defined
                                  * _ANSI_C_SOURCE */