summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2007-08-17 12:57:41 (GMT)
committerSkip Montanaro <skip@pobox.com>2007-08-17 12:57:41 (GMT)
commiteb33e5ae79542371a165bdb67099d14b7557a698 (patch)
treeb5e2bab1636a590bf389a38965afaab1cbd90628 /Modules
parente9af284e998abe3ab974b488d97c5db69c5aebf4 (diff)
downloadcpython-eb33e5ae79542371a165bdb67099d14b7557a698.zip
cpython-eb33e5ae79542371a165bdb67099d14b7557a698.tar.gz
cpython-eb33e5ae79542371a165bdb67099d14b7557a698.tar.bz2
Remove support for BeOS
Diffstat (limited to 'Modules')
-rw-r--r--Modules/expat/expat_external.h2
-rw-r--r--Modules/selectmodule.c6
-rw-r--r--Modules/socketmodule.c33
-rw-r--r--Modules/socketmodule.h2
-rw-r--r--Modules/timemodule.c25
5 files changed, 6 insertions, 62 deletions
diff --git a/Modules/expat/expat_external.h b/Modules/expat/expat_external.h
index f054014..3f1c363 100644
--- a/Modules/expat/expat_external.h
+++ b/Modules/expat/expat_external.h
@@ -11,7 +11,7 @@
co-exist. */
#include "pyexpatns.h"
-#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
+#if defined(_MSC_EXTENSIONS) && !defined(__CYGWIN__)
#define XML_USE_MSC_EXTENSIONS 1
#endif
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 995f8e7..8bb2df8 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -2,8 +2,6 @@
Under Unix, the file descriptors are small integers.
Under Win32, select only exists for sockets, and sockets may
have any value except INVALID_SOCKET.
- Under BeOS, we suffer the same dichotomy as Win32; sockets can be anything
- >= 0.
*/
#include "Python.h"
@@ -49,9 +47,7 @@ extern void bzero(void *, int);
# include <winsock.h>
#else
# define SOCKET int
-# ifdef __BEOS__
-# include <net/socket.h>
-# elif defined(__VMS)
+# if defined(__VMS)
# include <socket.h>
# endif
#endif
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index d8ea423..3ad7039 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -242,9 +242,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\
# include <netdb.h>
/* Headers needed for inet_ntoa() and inet_addr() */
-# ifdef __BEOS__
-# include <net/netdb.h>
-# elif defined(PYOS_OS2) && defined(PYCC_VACPP)
+# if defined(PYOS_OS2) && defined(PYCC_VACPP)
# include <netdb.h>
typedef size_t socklen_t;
# else
@@ -326,8 +324,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
#include "getnameinfo.c"
#endif
-#if defined(MS_WINDOWS) || defined(__BEOS__)
-/* BeOS suffers from the same socket dichotomy as Win32... - [cjh] */
+#if defined(MS_WINDOWS)
/* seem to be a few differences in the API */
#define SOCKETCLOSE closesocket
#define NO_DUP /* Actually it exists on NT 3.5, but what the heck... */
@@ -650,11 +647,6 @@ internal_setblocking(PySocketSockObject *s, int block)
#endif
Py_BEGIN_ALLOW_THREADS
-#ifdef __BEOS__
- block = !block;
- setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK,
- (void *)(&block), sizeof(int));
-#else
#ifndef MS_WINDOWS
#if defined(PYOS_OS2) && !defined(PYCC_GCC)
block = !block;
@@ -674,7 +666,6 @@ internal_setblocking(PySocketSockObject *s, int block)
block = !block;
ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block);
#endif /* MS_WINDOWS */
-#endif /* __BEOS__ */
Py_END_ALLOW_THREADS
/* Since these don't return anything */
@@ -992,11 +983,6 @@ makesockaddr(int sockfd, struct sockaddr *addr, int addrlen, int proto)
return Py_None;
}
-#ifdef __BEOS__
- /* XXX: BeOS version of accept() doesn't set family correctly */
- addr->sa_family = AF_INET;
-#endif
-
switch (addr->sa_family) {
case AF_INET:
@@ -1715,12 +1701,6 @@ sock_getsockopt(PySocketSockObject *s, PyObject *args)
PyObject *buf;
socklen_t buflen = 0;
-#ifdef __BEOS__
- /* We have incomplete socket support. */
- PyErr_SetString(socket_error, "getsockopt not supported");
- return NULL;
-#else
-
if (!PyArg_ParseTuple(args, "ii|i:getsockopt",
&level, &optname, &buflen))
return NULL;
@@ -1759,7 +1739,6 @@ sock_getsockopt(PySocketSockObject *s, PyObject *args)
return NULL;
}
return buf;
-#endif /* __BEOS__ */
}
PyDoc_STRVAR(getsockopt_doc,
@@ -3248,11 +3227,6 @@ socket_getprotobyname(PyObject *self, PyObject *args)
{
char *name;
struct protoent *sp;
-#ifdef __BEOS__
-/* Not available in BeOS yet. - [cjh] */
- PyErr_SetString(socket_error, "getprotobyname not supported");
- return NULL;
-#else
if (!PyArg_ParseTuple(args, "s:getprotobyname", &name))
return NULL;
Py_BEGIN_ALLOW_THREADS
@@ -3263,7 +3237,6 @@ socket_getprotobyname(PyObject *self, PyObject *args)
return NULL;
}
return PyInt_FromLong((long) sp->p_proto);
-#endif
}
PyDoc_STRVAR(getprotobyname_doc,
@@ -4277,14 +4250,12 @@ init_socket(void)
/* Socket types */
PyModule_AddIntConstant(m, "SOCK_STREAM", SOCK_STREAM);
PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM);
-#ifndef __BEOS__
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
#if defined(SOCK_RDM)
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
#endif
-#endif
#ifdef SO_DEBUG
PyModule_AddIntConstant(m, "SO_DEBUG", SO_DEBUG);
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index a4382ab..9c9b694 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -8,7 +8,7 @@
# include <sys/socket.h>
# endif
# include <netinet/in.h>
-# if !(defined(__BEOS__) || defined(__CYGWIN__) || (defined(PYOS_OS2) && defined(PYCC_VACPP)))
+# if defined(__CYGWIN__) || (defined(PYOS_OS2) && defined(PYCC_VACPP))
# include <netinet/tcp.h>
# endif
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 4bf3a9c..45002a1 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -80,13 +80,6 @@ static long main_thread;
#include <sys/time.h>
#endif
-#ifdef __BEOS__
-#include <time.h>
-/* For bigtime_t, snooze(). - [cjh] */
-#include <support/SupportDefs.h>
-#include <kernel/OS.h>
-#endif
-
/* Forward declarations */
static int floatsleep(double);
static double floattime(void);
@@ -894,7 +887,7 @@ static int
floatsleep(double secs)
{
/* XXX Should test for MS_WINDOWS first! */
-#if defined(HAVE_SELECT) && !defined(__BEOS__) && !defined(__EMX__)
+#if defined(HAVE_SELECT) && !defined(__EMX__)
struct timeval t;
double frac;
frac = fmod(secs, 1.0);
@@ -963,22 +956,6 @@ floatsleep(double secs)
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
- /* This sleep *CAN BE* interrupted. */
- {
- if( secs <= 0.0 ) {
- return;
- }
-
- Py_BEGIN_ALLOW_THREADS
- /* BeOS snooze() is in microseconds... */
- if( snooze( (bigtime_t)( secs * 1000.0 * 1000.0 ) ) == B_INTERRUPTED ) {
- Py_BLOCK_THREADS
- PyErr_SetFromErrno( PyExc_IOError );
- return -1;
- }
- Py_END_ALLOW_THREADS
- }
#elif defined(PLAN9)
{
double millisecs = secs * 1000.0;