diff -urN Python-2.6.6/Modules/resource.c Python-2.6.6-haiku/Modules/resource.c --- Python-2.6.6/Modules/resource.c 2010-05-09 15:15:40.020971520 +0000 +++ Python-2.6.6-haiku/Modules/resource.c 2010-08-29 23:31:01.967311360 +0000 @@ -86,6 +86,7 @@ PyFloat_FromDouble(doubletime(ru.ru_utime))); PyStructSequence_SET_ITEM(result, 1, PyFloat_FromDouble(doubletime(ru.ru_stime))); +#ifndef __HAIKU__ PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss)); PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss)); PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss)); @@ -100,7 +101,7 @@ PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals)); PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw)); PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw)); - +#endif if (PyErr_Occurred()) { Py_DECREF(result); return NULL; diff -urN Python-2.6.6/Modules/socketmodule.h Python-2.6.6-haiku/Modules/socketmodule.h --- Python-2.6.6/Modules/socketmodule.h 2010-05-09 15:15:40.020971520 +0000 +++ Python-2.6.6-haiku/Modules/socketmodule.h 2010-08-29 23:26:23.269746176 +0000 @@ -47,6 +47,10 @@ # undef AF_NETLINK #endif +#if defined(__HAIKU__) +#undef HAVE_BLUETOOTH_BLUETOOTH_H +#endif + #ifdef HAVE_BLUETOOTH_BLUETOOTH_H #include #include diff -urN Python-2.6.6/Modules/spwdmodule.c Python-2.6.6-haiku/Modules/spwdmodule.c --- Python-2.6.6/Modules/spwdmodule.c 2010-05-09 15:15:40.064749568 +0000 +++ Python-2.6.6-haiku/Modules/spwdmodule.c 2010-08-29 23:33:33.966524928 +0000 @@ -79,7 +79,9 @@ SETS(setIndex++, p->sp_namp); SETS(setIndex++, p->sp_pwdp); +#ifndef __HAIKU__ SETI(setIndex++, p->sp_lstchg); +#endif SETI(setIndex++, p->sp_min); SETI(setIndex++, p->sp_max); SETI(setIndex++, p->sp_warn); diff -urN Python-2.6.6/Modules/timemodule.c Python-2.6.6-haiku/Modules/timemodule.c --- Python-2.6.6/Modules/timemodule.c 2010-05-09 15:15:40.049545216 +0000 +++ Python-2.6.6-haiku/Modules/timemodule.c 2010-08-29 23:35:18.197918720 +0000 @@ -968,11 +968,11 @@ return -1; } Py_END_ALLOW_THREADS -#elif defined(__BEOS__) +#elif defined(__BEOS__) || defined(__HAIKU__) /* This sleep *CAN BE* interrupted. */ { if( secs <= 0.0 ) { - return; + return 0; } Py_BEGIN_ALLOW_THREADS diff -urN Python-2.6.6/Parser/asdl_c.py Python-2.6.6-haiku/Parser/asdl_c.py --- Python-2.6.6/Parser/asdl_c.py 2009-12-13 00:59:01.027000832 +0000 +++ Python-2.6.6-haiku/Parser/asdl_c.py 2010-08-29 23:27:12.271319040 +0000 @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /bin/env python """Generate C code from an ASDL description.""" # TO DO diff -urN Python-2.6.6/Python/bltinmodule.c Python-2.6.6-haiku/Python/bltinmodule.c --- Python-2.6.6/Python/bltinmodule.c 2010-05-09 15:15:40.032243712 +0000 +++ Python-2.6.6-haiku/Python/bltinmodule.c 2010-08-29 23:27:30.382992384 +0000 @@ -18,7 +18,7 @@ */ #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) const char *Py_FileSystemDefaultEncoding = "mbcs"; -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__HAIKU__) const char *Py_FileSystemDefaultEncoding = "utf-8"; #else const char *Py_FileSystemDefaultEncoding = NULL; /* use default */ diff -urN Python-2.6.6/Tools/scripts/h2py.py Python-2.6.6-haiku/Tools/scripts/h2py.py --- Python-2.6.6/Tools/scripts/h2py.py 2004-08-09 17:27:55.033816576 +0000 +++ Python-2.6.6-haiku/Tools/scripts/h2py.py 2010-08-29 23:28:01.171704320 +0000 @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /bin/env python # Read #define's and translate to Python code. # Handle #include statements. @@ -50,7 +50,7 @@ searchdirs=os.environ['INCLUDE'].split(';') except KeyError: try: - if sys.platform.find("beos") == 0: + if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0: searchdirs=os.environ['BEINCLUDES'].split(';') elif sys.platform.startswith("atheos"): searchdirs=os.environ['C_INCLUDE_PATH'].split(':') diff -urN Python-2.6.6/configure.in Python-2.6.6-haiku/configure.in --- Python-2.6.6/configure.in 2010-05-25 02:27:03.031195136 +0000 +++ Python-2.6.6-haiku/configure.in 2010-08-29 23:24:40.751828992 +0000 @@ -745,7 +745,7 @@ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} INSTSONAME="$LDLIBRARY".$SOVERSION ;; - Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*) + Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} @@ -823,7 +823,7 @@ AC_SUBST(LN) if test -z "$LN" ; then case $ac_sys_system in - BeOS*) LN="ln -s";; + BeOS*|Haiku*) LN="ln -s";; CYGWIN*) LN="ln -s";; atheos*) LN="ln -s";; *) LN=ln;; @@ -1829,7 +1829,7 @@ fi fi ;; - Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';; + Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';; BSD/OS*/4*) LDSHARED="gcc -shared";; FreeBSD*) if [[ "`$CC -dM -E -