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

Skip to content

Commit 9575a44

Browse files
committed
* Microscopic corrections to make things compile on the Cray APP.
* Removed one use of $> in Makefile and warned about others. Added configurable lines in Makefile to change CC and AR.
1 parent f56e3db commit 9575a44

6 files changed

Lines changed: 31 additions & 4 deletions

File tree

Modules/arraymodule.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,16 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3131
#include "modsupport.h"
3232
#include "ceval.h"
3333

34+
#ifdef i860
35+
/* Cray APP doesn't have memmove */
36+
#define NEED_MEMMOVE
37+
extern char *memcpy();
38+
#endif
39+
3440
#ifdef sun
41+
/* SunOS doesn't have memmove */
3542
#define NEED_MEMMOVE
43+
extern char *memcpy();
3644
#endif
3745

3846
#ifdef NEED_MEMMOVE

Modules/mathmodule.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ extern int errno;
3535

3636
#include <math.h>
3737

38+
#ifdef i860
39+
/* Cray APP has bogus definition of HUGE_VAL in <math.h> */
40+
#undef HUGE_VAL
41+
#endif
42+
3843
#ifndef __STDC__
3944
extern double fmod PROTO((double, double));
4045
#endif

Modules/socketmodule.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ Socket methods:
8282
#include <sys/un.h>
8383
#include <netdb.h>
8484

85+
#ifdef i860
86+
/* Cray APP doesn't have getpeername() */
87+
#define NO_GETPEERNAME
88+
#endif
89+
8590

8691
/* Global variable holding the exception type for errors detected
8792
by this module (but not argument type or memory errors, etc.). */
@@ -594,6 +599,7 @@ sock_getsockname(s, args)
594599
}
595600

596601

602+
#ifndef NO_GETPEERNAME
597603
/* s.getpeername() method */
598604

599605
static object *
@@ -614,6 +620,7 @@ sock_getpeername(s, args)
614620
return socket_error();
615621
return makesockaddr((struct sockaddr *) addrbuf, addrlen);
616622
}
623+
#endif
617624

618625

619626
/* s.listen(n) method */
@@ -809,7 +816,9 @@ static struct methodlist sock_methods[] = {
809816
{"connect", sock_connect},
810817
{"fileno", sock_fileno},
811818
{"getsockname", sock_getsockname},
819+
#ifndef NO_GETPEERNAME
812820
{"getpeername", sock_getpeername},
821+
#endif
813822
{"listen", sock_listen},
814823
{"makefile", sock_makefile},
815824
{"recv", sock_recv},

Objects/floatobject.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ extern int errno;
3838
#include <ctype.h>
3939
#include <math.h>
4040

41+
#ifdef i860
42+
/* Cray APP has bogus definition of HUGE_VAL in <math.h> */
43+
#undef HUGE_VAL
44+
#endif
45+
4146
#ifdef HUGE_VAL
4247
#define CHECK(x) if (errno != 0) ; \
4348
else if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \
@@ -170,6 +175,7 @@ float_hash(v)
170175
}
171176
else {
172177
fractpart = frexp(fractpart, &expo);
178+
fractpart = fractpart*4294967296.0; /* 2**32 */
173179
x = (long) (intpart + fractpart) ^ expo; /* Rather arbitrary */
174180
}
175181
if (x == -1)

Objects/intobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ int_int(v)
426426
intobject *v;
427427
{
428428
INCREF(v);
429-
return v;
429+
return (object *)v;
430430
}
431431

432432
static object *
@@ -512,5 +512,5 @@ typeobject Inttype = {
512512
&int_as_number, /*tp_as_number*/
513513
0, /*tp_as_sequence*/
514514
0, /*tp_as_mapping*/
515-
&int_hash, /*tp_hash*/
515+
int_hash, /*tp_hash*/
516516
};

Python/ceval.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,8 @@ save_thread()
125125
release_lock(interpreter_lock);
126126
return res;
127127
}
128-
else
129-
return NULL;
130128
#endif
129+
return NULL;
131130
}
132131

133132
void

0 commit comments

Comments
 (0)