SF patch #474590 -- RISC OS support
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index f02b15a..e480fb4 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -52,14 +52,6 @@
#endif
#endif
-#ifdef RISCOS
-#define NO_DUP
-#undef off_t
-#undef uid_t
-#undef gid_t
-#undef errno
-#include "socklib.h"
-#endif /* RISCOS */
static PyObject *SelectError;
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 377c792..1d9a13d 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -130,20 +130,6 @@
#include <os2.h>
#endif
-#ifdef RISCOS
-#define NO_DUP
-#undef off_t
-#undef uid_t
-#undef gid_t
-#undef errno
-#include <signal.h>
-#include "socklib.h"
-#include "inetlib.h"
-#include "netdb.h"
-#include "unixlib.h"
-#include "netinet/in.h"
-#include "sys/ioctl.h"
-#else /*RISCOS*/
#include <sys/types.h>
@@ -165,13 +151,18 @@
#endif
#endif
+#ifndef RISCOS
#include <fcntl.h>
#else
+#include <sys/fcntl.h>
+#define NO_DUP
+int h_errno; /* not used */
+#endif
+#else
#include <winsock.h>
#include <fcntl.h>
#endif
-#endif /*RISCOS*/
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
@@ -1804,7 +1795,11 @@
if (h == NULL) {
/* Let's get real error message to return */
+#ifndef RISCOS
PyH_Err(h_errno);
+#else
+ PyErr_SetString(PySocket_Error, "host not found");
+#endif
return NULL;
}
if (h->h_addrtype != af) {
diff --git a/Modules/structmodule.c b/Modules/structmodule.c
index 61436f9..8cc4945 100644
--- a/Modules/structmodule.c
+++ b/Modules/structmodule.c
@@ -53,19 +53,19 @@
#endif
#endif /* __MWERKS__ */
-typedef struct { char c; short x; } s_short;
-typedef struct { char c; int x; } s_int;
-typedef struct { char c; long x; } s_long;
-typedef struct { char c; float x; } s_float;
-typedef struct { char c; double x; } s_double;
-typedef struct { char c; void *x; } s_void_p;
+typedef struct { char c; short x; } st_short;
+typedef struct { char c; int x; } st_int;
+typedef struct { char c; long x; } st_long;
+typedef struct { char c; float x; } st_float;
+typedef struct { char c; double x; } st_double;
+typedef struct { char c; void *x; } st_void_p;
-#define SHORT_ALIGN (sizeof(s_short) - sizeof(short))
-#define INT_ALIGN (sizeof(s_int) - sizeof(int))
-#define LONG_ALIGN (sizeof(s_long) - sizeof(long))
-#define FLOAT_ALIGN (sizeof(s_float) - sizeof(float))
-#define DOUBLE_ALIGN (sizeof(s_double) - sizeof(double))
-#define VOID_P_ALIGN (sizeof(s_void_p) - sizeof(void *))
+#define SHORT_ALIGN (sizeof(st_short) - sizeof(short))
+#define INT_ALIGN (sizeof(st_int) - sizeof(int))
+#define LONG_ALIGN (sizeof(st_long) - sizeof(long))
+#define FLOAT_ALIGN (sizeof(st_float) - sizeof(float))
+#define DOUBLE_ALIGN (sizeof(st_double) - sizeof(double))
+#define VOID_P_ALIGN (sizeof(st_void_p) - sizeof(void *))
/* We can't support q and Q in native mode unless the compiler does;
in std mode, they're 8 bytes on all platforms. */
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index bb7f358..ef5ab92 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -17,9 +17,7 @@
#define GUSI_TO_MSL_EPOCH (4*365*24*60*60)
#endif /* USE_GUSI2 */
#else
-#ifndef RISCOS
#include <sys/types.h>
-#endif /* RISCOS */
#endif
#ifdef QUICKWIN