1 |
grobian 11/09/01 13:07:52 |
2 |
|
3 |
Added: dulwich-0.8.0-darwin.patch |
4 |
Log: |
5 |
Fix compilation on older Darwin hosts, upstream bug 822427 |
6 |
|
7 |
(Portage version: 2.2.01.19074-prefix/cvs/SunOS i386) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 dev-python/dulwich/files/dulwich-0.8.0-darwin.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/dulwich/files/dulwich-0.8.0-darwin.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/dulwich/files/dulwich-0.8.0-darwin.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: dulwich-0.8.0-darwin.patch |
16 |
=================================================================== |
17 |
https://bugs.launchpad.net/dulwich/+bug/822427 |
18 |
|
19 |
--- dulwich/_objects.c |
20 |
+++ dulwich/_objects.c |
21 |
@@ -21,21 +21,15 @@ |
22 |
#include <stdlib.h> |
23 |
#include <sys/stat.h> |
24 |
|
25 |
-#if defined(__APPLE__) |
26 |
-#include <Availability.h> |
27 |
-#endif |
28 |
- |
29 |
#if (PY_VERSION_HEX < 0x02050000) |
30 |
typedef int Py_ssize_t; |
31 |
#endif |
32 |
|
33 |
-#if defined(__MINGW32_VERSION) || (defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1070) |
34 |
-size_t strnlen(char *text, size_t maxlen) |
35 |
+static size_t dwstrnlen(char *text, size_t maxlen) |
36 |
{ |
37 |
const char *last = memchr(text, '\0', maxlen); |
38 |
return last ? (size_t) (last - text) : maxlen; |
39 |
} |
40 |
-#endif |
41 |
|
42 |
#define bytehex(x) (((x)<0xa)?('0'+(x)):('a'-0xa+(x))) |
43 |
|
44 |
@@ -98,7 +92,7 @@ |
45 |
|
46 |
text++; |
47 |
|
48 |
- namelen = strnlen(text, len - (text - start)); |
49 |
+ namelen = dwstrnlen(text, len - (text - start)); |
50 |
|
51 |
name = PyString_FromStringAndSize(text, namelen); |
52 |
if (name == NULL) { |