215
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
216
int main(int Argc, char *Argv[])
221
int main(int Argc, char *ARGV[])
219
224
#define PROG_NAME_SIZE 39
228
233
LHASH_OF(FUNCTION) *prog=NULL;
236
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
238
* If we have 32-bit pointers everywhere, then we're safe, and
239
* we bypass this mess, as on non-VMS systems. (See ARGV,
241
* Problem 1: Compaq/HP C before V7.3 always used 32-bit
242
* pointers for argv[].
243
* Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
244
* everywhere else, we always allocate and use a 64-bit
245
* duplicate of argv[].
246
* Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed
247
* to NULL-terminate a 64-bit argv[]. (As this was written, the
248
* compiler ECO was available only on IA64.)
249
* Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a
250
* 64-bit argv[argc] for NULL, and, if necessary, use a
251
* (properly) NULL-terminated (64-bit) duplicate of argv[].
252
* The same code is used in either case to duplicate argv[].
253
* Some of these decisions could be handled in preprocessing,
254
* but the code tends to get even uglier, and the penalty for
255
* deciding at compile- or run-time is tiny.
260
if ((sizeof( _Argv) < 8) /* 32-bit argv[]. */
261
# if !defined( VMS_TRUST_ARGV)
262
|| (_Argv[ Argc] != NULL) /* Untrusted argv[argc] not NULL. */
267
Argv = OPENSSL_malloc( (Argc+ 1)* sizeof( char *));
269
{ ret = -1; goto end; }
270
for(i = 0; i < Argc; i++)
272
Argv[ Argc] = NULL; /* Certain NULL termination. */
277
/* Use the known-good 32-bit argv[] (which needs the
278
* type cast to satisfy the compiler), or the trusted or
279
* tested-good 64-bit argv[] as-is. */
280
Argv = (char **)_Argv;
282
#endif /* defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64) */