From 087ca80ad83071dde0bb6bc1c28c743caa00eaf8 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 30 Mar 2016 08:35:18 +0200 Subject: Fix pointer size issues with argv on VMS The argument 'argv' in 'main' is a short pointer to a short pointer on VMS, regardless of initial pointer size. We must therefore make sure that 'copy_argv' gets a 32-bit pointer for argv, and that the copied argv is used for the rest of main(). This introduces the local type argv_t, which will have correct pointer size in all cases (and be harmless on all other platforms) as well as the macro Argv, which is defined as 'copied_argv' or 'argv', as the case may be. Reviewed-by: Andy Polyakov --- apps/apps.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'apps/apps.h') diff --git a/apps/apps.h b/apps/apps.h index fc480e16c8..7cf0dc4b6a 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -445,6 +445,17 @@ typedef struct args_st { char **argv; } ARGS; +#if defined(OPENSSL_SYS_VMS) && defined(__DECC) +# pragma pointer_size save +# pragma pointer_size 32 +typedef char **argv_t; +# pragma pointer_size restore +char **copy_argv(int *argc, argv_t argv); +#else +typedef char **argv_t; +#endif + + # define PW_MIN_LENGTH 4 typedef struct pw_cb_data { const void *password; -- cgit v1.2.3