mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
Force argv to be an array of long pointers on VMS
Reverts commit 087ca80ad8
Instead of battling the odd format of argv given to main() in default
P64 mode, tell the compiler to make it an array of 64-bit pointers
when compiling in P64 mode.
A note is added in NOTES.VMS regarding minimum DEC C version.
Reviewed-by: Andy Polyakov <appro@openssl.org>
This commit is contained in:
parent
5902821d81
commit
368058d0a7
@ -1763,7 +1763,7 @@ sub vms_info {
|
||||
"vms-alpha-p64" => {
|
||||
inherit_from => [ "vms-alpha" ],
|
||||
cflags =>
|
||||
add("/POINTER_SIZE=64",
|
||||
add("/POINTER_SIZE=64=ARGV",
|
||||
sub { my @warnings =
|
||||
@{vms_info()->{disable_warns_p64}};
|
||||
@warnings
|
||||
@ -1796,7 +1796,7 @@ sub vms_info {
|
||||
"vms-ia64-p64" => {
|
||||
inherit_from => [ "vms-ia64" ],
|
||||
cflags =>
|
||||
add("/POINTER_SIZE=64",
|
||||
add("/POINTER_SIZE=64=ARGV",
|
||||
sub { my @warnings =
|
||||
@{vms_info()->{disable_warns_p64}};
|
||||
@warnings
|
||||
|
@ -18,8 +18,9 @@
|
||||
An ANSI C compiled is needed among other things. This means that
|
||||
VAX C is not and will not be supported.
|
||||
|
||||
We have only tested with DEC C (a.k.a HP VMS C / VSI C), compiling
|
||||
with a different ANSI C compiler may require some work.
|
||||
We have only tested with DEC C (a.k.a HP VMS C / VSI C) and require
|
||||
version 7.1 or later. Compiling with a different ANSI C compiler may
|
||||
require some work.
|
||||
|
||||
Please avoid using C RTL feature logical names DECC$* when building
|
||||
and testing OpenSSL. Most of all, they can be disruptive when
|
||||
|
15
apps/apps.h
15
apps/apps.h
@ -445,15 +445,12 @@ 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
|
||||
/*
|
||||
* VMS C only for now, implemented in vms_decc_init.c
|
||||
* If other C compilers forget to terminate argv with NULL, this function
|
||||
* can be re-used.
|
||||
*/
|
||||
char **copy_argv(int *argc, char *argv[]);
|
||||
|
||||
|
||||
# define PW_MIN_LENGTH 4
|
||||
|
@ -216,7 +216,6 @@ int main(int argc, char *argv[])
|
||||
FUNCTION f, *fp;
|
||||
LHASH_OF(FUNCTION) *prog = NULL;
|
||||
char **copied_argv = NULL;
|
||||
char **argv_alias = NULL;
|
||||
char *p, *pname;
|
||||
char buf[1024];
|
||||
const char *prompt;
|
||||
@ -232,10 +231,8 @@ int main(int argc, char *argv[])
|
||||
bio_out = dup_bio_out(FORMAT_TEXT);
|
||||
bio_err = dup_bio_err(FORMAT_TEXT);
|
||||
|
||||
#if defined( OPENSSL_SYS_VMS) && defined(__DECC)
|
||||
copied_argv = argv_alias = copy_argv(&argc, argv);
|
||||
#else
|
||||
argv_alias = argv;
|
||||
#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
|
||||
copied_argv = argv = copy_argv(&argc, argv);
|
||||
#endif
|
||||
|
||||
p = getenv("OPENSSL_DEBUG_MEMORY");
|
||||
@ -259,22 +256,22 @@ int main(int argc, char *argv[])
|
||||
goto end;
|
||||
|
||||
prog = prog_init();
|
||||
pname = opt_progname(argv_alias[0]);
|
||||
pname = opt_progname(argv[0]);
|
||||
|
||||
/* first check the program name */
|
||||
f.name = pname;
|
||||
fp = lh_FUNCTION_retrieve(prog, &f);
|
||||
if (fp != NULL) {
|
||||
argv_alias[0] = pname;
|
||||
ret = fp->func(argc, argv_alias);
|
||||
argv[0] = pname;
|
||||
ret = fp->func(argc, argv);
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* If there is stuff on the command line, run with that. */
|
||||
if (argc != 1) {
|
||||
argc--;
|
||||
argv_alias++;
|
||||
ret = do_cmd(prog, argc, argv_alias);
|
||||
argv++;
|
||||
ret = do_cmd(prog, argc, argv);
|
||||
if (ret < 0)
|
||||
ret = 0;
|
||||
goto end;
|
||||
|
@ -106,7 +106,7 @@ decc_feat_t decc_feat_array[] = {
|
||||
};
|
||||
|
||||
|
||||
char **copy_argv(int *argc, argv_t argv)
|
||||
char **copy_argv(int *argc, char *argv[])
|
||||
{
|
||||
/*-
|
||||
* The note below is for historical purpose. On VMS now we always
|
||||
|
Loading…
Reference in New Issue
Block a user