From: Jesse Noller Date: Tue, 31 Mar 2009 18:12:35 +0000 (+0000) Subject: Apply patch for netbsd multiprocessing support X-Git-Tag: v2.7a1~1699 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40a6164afa79f6b97e7e40e0f35f6081fde437c2;p=thirdparty%2FPython%2Fcpython.git Apply patch for netbsd multiprocessing support --- diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index d191c1e6fb12..bd7f7cc88890 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -509,7 +509,11 @@ mmap_resize_method(mmap_object *self, #ifdef MREMAP_MAYMOVE newmap = mremap(self->data, self->size, new_size, MREMAP_MAYMOVE); #else - newmap = mremap(self->data, self->size, new_size, 0); + #if defined(__NetBSD__) + newmap = mremap(self->data, self->size, self->data, new_size, 0); + #else + newmap = mremap(self->data, self->size, new_size, 0); + #endif /* __NetBSD__ */ #endif if (newmap == (void *)-1) { diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 9cefe045ce1a..b5f53a396f2e 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -379,7 +379,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); #define SOCKETCLOSE close #endif -#if defined(HAVE_BLUETOOTH_H) || defined(HAVE_BLUETOOTH_BLUETOOTH_H) +#if defined(HAVE_BLUETOOTH_H) || defined(HAVE_BLUETOOTH_BLUETOOTH_H) && !defined(__NetBSD__) #define USE_BLUETOOTH 1 #if defined(__FreeBSD__) #define BTPROTO_L2CAP BLUETOOTH_PROTO_L2CAP diff --git a/setup.py b/setup.py index f1e983d3f0fc..d3b39bad4160 100644 --- a/setup.py +++ b/setup.py @@ -1280,6 +1280,15 @@ class PyBuildExt(build_ext): ) libraries = [] + elif platform.startswith('netbsd'): + macros = dict( # at least NetBSD 5 + HAVE_SEM_OPEN=1, + HAVE_SEM_TIMEDWAIT=0, + HAVE_FD_TRANSFER=1, + HAVE_BROKEN_SEM_GETVALUE=1 + ) + libraries = [] + else: # Linux and other unices macros = dict( HAVE_SEM_OPEN=1,