Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a924e6

Browse files
committed
Patch #696645: Remove VMS code with uncertain authorship.
1 parent 0d58ba9 commit 7a924e6

3 files changed

Lines changed: 60 additions & 301 deletions

File tree

Modules/getbuildinfo.c

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -28,70 +28,11 @@
2828
#define BUILD 0
2929
#endif
3030

31-
#ifdef __VMS
32-
# ifdef __DECC
33-
# pragma extern_model save
34-
# pragma extern_model strict_refdef
35-
extern long ctl$gl_imghdrbf;
36-
# pragma extern_model restore
37-
# endif
38-
39-
# ifdef __ALPHA
40-
# define EIHD$L_IMGIDOFF 24
41-
# define EIHI$Q_LINKTIME 8
42-
# define _IMGIDOFF EIHD$L_IMGIDOFF
43-
# define _LINKTIME EIHI$Q_LINKTIME
44-
# else
45-
# define IHD$W_IMGIDOFF 6
46-
# define IHI$Q_LINKTIME 56
47-
# define _IMGIDOFF IHD$W_IMGIDOFF
48-
# define _LINKTIME IHI$Q_LINKTIME
49-
# endif /* __VMS */
50-
51-
long*
52-
vms__get_linktime (void)
53-
{
54-
long* al_imghdrbf;
55-
unsigned short* aw_imgidoff;
56-
unsigned short w_imgidoff;
57-
long* aq_linktime;
58-
unsigned char* ab_ihi;
59-
60-
al_imghdrbf = &ctl$gl_imghdrbf;
61-
62-
al_imghdrbf = (long *)*al_imghdrbf;
63-
al_imghdrbf = (long *)*al_imghdrbf;
64-
65-
aw_imgidoff = (unsigned short *)
66-
((unsigned char *)al_imghdrbf + _IMGIDOFF);
67-
68-
w_imgidoff = *aw_imgidoff;
69-
70-
ab_ihi = (unsigned char *)al_imghdrbf + w_imgidoff;
71-
72-
aq_linktime = (long *) (ab_ihi + _LINKTIME);
73-
74-
return aq_linktime;
75-
} /* vms__get_linktime (void) */
76-
extern void vms__cvt_v2u_time (long * aq_vmstime, time_t * al_unixtime);
77-
/* input , output */
78-
#endif /* __VMS */
79-
80-
8131
const char *
8232
Py_GetBuildInfo(void)
8333
{
8434
static char buildinfo[50];
85-
#ifdef __VMS
86-
time_t l_unixtime;
87-
88-
vms__cvt_v2u_time(vms__get_linktime (), &l_unixtime );
89-
90-
memset(buildinfo, 0, 40);
91-
sprintf(buildinfo, "#%d, %.24s", BUILD, ctime (&l_unixtime));
92-
#else
9335
PyOS_snprintf(buildinfo, sizeof(buildinfo),
9436
"#%d, %.20s, %.9s", BUILD, DATE, TIME);
95-
#endif
9637
return buildinfo;
9738
}

Modules/main.c

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
#include "compile.h" /* For CO_FUTURE_DIVISION */
66

77
#ifdef __VMS
8-
extern int PyVMS_init(int* pvi_argc, char*** pvi_argv);
9-
extern PyObject* pyvms_gr_empty_string;
8+
#include <unixlib.h>
109
#endif
1110

1211
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
@@ -305,7 +304,14 @@ Py_Main(int argc, char **argv)
305304
if (command == NULL && filename == NULL && _PyOS_optind < argc &&
306305
strcmp(argv[_PyOS_optind], "-") != 0)
307306
{
307+
#ifdef __VMS
308+
filename = decc$translate_vms(argv[_PyOS_optind]);
309+
if (filename == (char *)0 || filename == (char *)-1)
310+
filename = argv[_PyOS_optind];
311+
312+
#else
308313
filename = argv[_PyOS_optind];
314+
#endif
309315
if (filename != NULL) {
310316
if ((fp = fopen(filename, "r")) == NULL) {
311317
fprintf(stderr, "%s: can't open file '%s'\n",
@@ -370,43 +376,12 @@ Py_Main(int argc, char **argv)
370376
#endif /* __VMS */
371377

372378
Py_SetProgramName(argv[0]);
373-
#ifdef __VMS
374-
PyVMS_init(&argc, &argv);
375-
#endif
376379
Py_Initialize();
377380

378-
#ifdef __VMS
379-
/* create an empty string object */
380-
pyvms_gr_empty_string = Py_BuildValue("s#", Py_None, (unsigned int)0);
381-
#endif
382-
383381
if (Py_VerboseFlag ||
384382
(command == NULL && filename == NULL && stdin_is_interactive))
385-
#ifndef __VMS
386383
fprintf(stderr, "Python %s on %s\n%s\n",
387384
Py_GetVersion(), Py_GetPlatform(), COPYRIGHT);
388-
#else
389-
fprintf(stderr, "Python %s on %s %s (%s_float)\n%s\n",
390-
Py_GetVersion(), Py_GetPlatform(),
391-
# ifdef __ALPHA
392-
"Alpha",
393-
# else
394-
"VAX",
395-
# endif
396-
# if __IEEE_FLOAT
397-
"T",
398-
# else
399-
# if __D_FLOAT
400-
"D",
401-
# else
402-
# if __G_FLOAT
403-
"G",
404-
# endif /* __G_FLOAT */
405-
# endif /* __D_FLOAT */
406-
# endif /* __IEEE_FLOAT */
407-
COPYRIGHT); /* << @@ defined above in this file */
408-
/* Py_GetCopyright()); */
409-
#endif /* __VMS */
410385

411386
if (command != NULL) {
412387
/* Backup _PyOS_optind and force sys.argv[0] = '-c' */

0 commit comments

Comments
 (0)