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

Skip to content

Commit 4892f24

Browse files
committed
Got rid of a few more NeXT ifdefs. The last, I think.
1 parent e75bfde commit 4892f24

5 files changed

Lines changed: 1 addition & 113 deletions

File tree

Include/pyport.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ typedef struct fd_set {
453453
* Hide GCC attributes from compilers that don't support them.
454454
*/
455455
#if (!defined(__GNUC__) || __GNUC__ < 2 || \
456-
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \
457-
defined(NEXT) ) && \
456+
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) ) && \
458457
!defined(RISCOS)
459458
#define __attribute__(__x)
460459
#endif

Modules/fpectlmodule.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,6 @@ static void fpe_reset(Sigfunc *handler)
211211
#endif
212212
PyOS_setsig(SIGFPE, handler);
213213

214-
/*-- NeXT -----------------------------------------------------------------*/
215-
#elif defined(NeXT) && defined(m68k) && defined(__GNUC__)
216-
/* NeXT needs explicit csr set to generate SIGFPE */
217-
asm("fmovel #0x1400,fpcr"); /* set OVFL and ZD bits */
218-
PyOS_setsig(SIGFPE, handler);
219-
220214
/*-- Microsoft Windows, NT ------------------------------------------------*/
221215
#elif defined(_MSC_VER)
222216
/* Reference: Visual C++ Books Online 4.2,

Modules/grpmodule.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@ mkgrent(struct group *p)
2727
v = Py_BuildValue("(sslO)",
2828
p->gr_name,
2929
p->gr_passwd,
30-
#if defined(NeXT) && defined(_POSIX_SOURCE) && defined(__LITTLE_ENDIAN__)
31-
/* Correct a bug present on Intel machines in NextStep 3.2 and 3.3;
32-
for later versions you may have to remove this */
33-
(long)p->gr_short_pad, /* ugh-NeXT broke the padding */
34-
#else
3530
(long)p->gr_gid,
36-
#endif
3731
w);
3832
Py_DECREF(w);
3933
return v;

Modules/posixmodule.c

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,6 @@ extern int lstat(const char *, struct stat *);
118118
extern int symlink(const char *, const char *);
119119
#endif
120120

121-
#ifdef NeXT
122-
/* NeXT's <unistd.h> and <utime.h> aren't worth much */
123-
#undef HAVE_UNISTD_H
124-
#undef HAVE_UTIME_H
125-
#define HAVE_WAITPID
126-
/* #undef HAVE_GETCWD */
127-
#define UNION_WAIT /* This should really be checked for by autoconf */
128-
#endif
129-
130121
#ifndef HAVE_UNISTD_H
131122
#if defined(PYCC_VACPP)
132123
extern int mkdir(char *);
@@ -3323,11 +3314,7 @@ posix_waitpid(PyObject *self, PyObject *args)
33233314
if (!PyArg_ParseTuple(args, "ii:waitpid", &pid, &options))
33243315
return NULL;
33253316
Py_BEGIN_ALLOW_THREADS
3326-
#ifdef NeXT
3327-
pid = wait4(pid, &status, options, NULL);
3328-
#else
33293317
pid = waitpid(pid, &status, options);
3330-
#endif
33313318
Py_END_ALLOW_THREADS
33323319
if (pid == -1)
33333320
return posix_error();
@@ -3970,85 +3957,6 @@ posix_ftruncate(PyObject *self, PyObject *args)
39703957
}
39713958
#endif
39723959

3973-
#ifdef NeXT
3974-
#define HAVE_PUTENV
3975-
/* Steve Spicklemire got this putenv from NeXTAnswers */
3976-
static int
3977-
putenv(char *newval)
3978-
{
3979-
extern char **environ;
3980-
3981-
static int firstTime = 1;
3982-
char **ep;
3983-
char *cp;
3984-
int esiz;
3985-
char *np;
3986-
3987-
if (!(np = strchr(newval, '=')))
3988-
return 1;
3989-
*np = '\0';
3990-
3991-
/* look it up */
3992-
for (ep=environ ; *ep ; ep++)
3993-
{
3994-
/* this should always be true... */
3995-
if (cp = strchr(*ep, '='))
3996-
{
3997-
*cp = '\0';
3998-
if (!strcmp(*ep, newval))
3999-
{
4000-
/* got it! */
4001-
*cp = '=';
4002-
break;
4003-
}
4004-
*cp = '=';
4005-
}
4006-
else
4007-
{
4008-
*np = '=';
4009-
return 1;
4010-
}
4011-
}
4012-
4013-
*np = '=';
4014-
if (*ep)
4015-
{
4016-
/* the string was already there:
4017-
just replace it with the new one */
4018-
*ep = newval;
4019-
return 0;
4020-
}
4021-
4022-
/* expand environ by one */
4023-
for (esiz=2, ep=environ ; *ep ; ep++)
4024-
esiz++;
4025-
if (firstTime)
4026-
{
4027-
char **epp;
4028-
char **newenv;
4029-
if (!(newenv = malloc(esiz * sizeof(char *))))
4030-
return 1;
4031-
4032-
for (ep=environ, epp=newenv ; *ep ;)
4033-
*epp++ = *ep++;
4034-
*epp++ = newval;
4035-
*epp = (char *) 0;
4036-
environ = newenv;
4037-
}
4038-
else
4039-
{
4040-
if (!(environ = realloc(environ, esiz * sizeof(char *))))
4041-
return 1;
4042-
environ[esiz - 2] = newval;
4043-
environ[esiz - 1] = (char *) 0;
4044-
firstTime = 0;
4045-
}
4046-
4047-
return 0;
4048-
}
4049-
#endif /* NeXT */
4050-
4051-
40523960
#ifdef HAVE_PUTENV
40533961
static char posix_putenv__doc__[] =
40543962
"putenv(key, value) -> None\n\

Modules/pwdmodule.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,8 @@ mkpwent(struct passwd *p)
2424
"(ssllsss)",
2525
p->pw_name,
2626
p->pw_passwd,
27-
#if defined(NeXT) && defined(_POSIX_SOURCE) && defined(__LITTLE_ENDIAN__)
28-
/* Correct a bug present on Intel machines in NextStep 3.2 and 3.3;
29-
for later versions you may have to remove this */
30-
(long)p->pw_short_pad1, /* ugh-NeXT broke the padding */
31-
(long)p->pw_short_pad2,
32-
#else
3327
(long)p->pw_uid,
3428
(long)p->pw_gid,
35-
#endif
3629
p->pw_gecos,
3730
p->pw_dir,
3831
p->pw_shell);

0 commit comments

Comments
 (0)