diff -Nurwb -x __pycache__ -x OWbuild -x '*.dll' -x '*.exe' Python-3.3.2-original/Include/pyport.h Python-3.3.2/Include/pyport.h --- Python-3.3.2-original/Include/pyport.h 2013-09-18 20:54:08.000000000 -0400 +++ Python-3.3.2/Include/pyport.h 2013-10-22 20:47:21.000000000 -0400 @@ -871,6 +871,10 @@ #define Py_ULL(x) Py_LL(x##U) #endif +#if defined(__WATCOMC__) +#include +#endif + #ifdef VA_LIST_IS_ARRAY #define Py_VA_COPY(x, y) Py_MEMCPY((x), (y), sizeof(va_list)) #else diff -Nurwb -x __pycache__ -x OWbuild -x '*.dll' -x '*.exe' Python-3.3.2-original/Modules/main.c Python-3.3.2/Modules/main.c --- Python-3.3.2-original/Modules/main.c 2013-09-18 20:54:11.000000000 -0400 +++ Python-3.3.2/Modules/main.c 2013-09-18 21:52:28.000000000 -0400 @@ -14,9 +14,11 @@ #include #ifdef HAVE_FCNTL_H #include +#if !defined(PATH_MAX) #define PATH_MAX MAXPATHLEN #endif #endif +#endif #ifdef _MSC_VER #include @@ -489,7 +491,7 @@ (p = Py_GETENV("PYTHONNOUSERSITE")) && *p != '\0') Py_NoUserSiteDirectory = 1; -#ifdef MS_WINDOWS +#if defined(MS_WINDOWS) && !defined(__WATCOMC__) if (!Py_IgnoreEnvironmentFlag && (wp = _wgetenv(L"PYTHONWARNINGS")) && *wp != L'\0') { wchar_t *buf, *warning; diff -Nurwb -x __pycache__ -x OWbuild -x '*.dll' -x '*.exe' Python-3.3.2-original/Modules/posixmodule.c Python-3.3.2/Modules/posixmodule.c --- Python-3.3.2-original/Modules/posixmodule.c 2013-09-18 20:54:10.000000000 -0400 +++ Python-3.3.2/Modules/posixmodule.c 2013-10-22 20:57:57.000000000 -0400 @@ -246,7 +246,9 @@ extern int lchmod(const char *, mode_t); #endif*/ extern int chown(const char *, uid_t, gid_t); +#ifndef __WATCOMC__ extern char *getcwd(char *, int); +#endif extern char *strerror(int); extern int link(const char *, const char *); extern int rename(const char *, const char *); @@ -305,7 +307,7 @@ #endif #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || (defined(__WATCOMC__) && defined(MS_WINDOWS)) #ifdef HAVE_DIRECT_H #include #endif @@ -315,6 +317,11 @@ #ifdef HAVE_PROCESS_H #include #endif +#include "osdefs.h" +#include +#include +#include /* for ShellExecute() */ +#include /* for UNLEN */ #ifndef VOLUME_NAME_DOS #define VOLUME_NAME_DOS 0x0 #endif @@ -324,11 +331,6 @@ #ifndef IO_REPARSE_TAG_SYMLINK #define IO_REPARSE_TAG_SYMLINK (0xA000000CL) #endif -#include "osdefs.h" -#include -#include -#include /* for ShellExecute() */ -#include /* for UNLEN */ #ifdef SE_CREATE_SYMBOLIC_LINK_NAME /* Available starting with Vista */ #define HAVE_SYMLINK static int win32_can_symlink = 0; diff -Nurwb -x __pycache__ -x OWbuild -x '*.dll' -x '*.exe' Python-3.3.2-original/Modules/timemodule.c Python-3.3.2/Modules/timemodule.c --- Python-3.3.2-original/Modules/timemodule.c 2013-09-18 20:54:10.000000000 -0400 +++ Python-3.3.2/Modules/timemodule.c 2013-09-19 21:32:31.000000000 -0400 @@ -20,9 +20,6 @@ #include #endif -#if defined(__WATCOMC__) && !defined(__QNX__) -#include -#else #ifdef MS_WINDOWS #define WIN32_LEAN_AND_MEAN #include @@ -34,8 +31,13 @@ #define tzname _tzname #define daylight _daylight #endif /* __BORLANDC__ */ -#endif /* MS_WINDOWS */ +#else +#if defined(__WATCOMC__) && !defined(__QNX__) +/* Watcom, but not Watcom for Windows */ +#include #endif /* !__WATCOMC__ || __QNX__ */ +#endif /* MS_WINDOWS */ + #if defined(PYOS_OS2) #define INCL_DOS @@ -718,6 +720,10 @@ Parse a string to a time tuple according to a format specification.\n\ See the library reference manual for formatting codes (same as strftime())."); +#if defined(MS_WINDOWS) && defined(__WATCOMC__) +#define _asctime _pyasctime +#endif + static PyObject * _asctime(struct tm *timeptr) { @@ -1548,11 +1554,6 @@ return -1; } } -#elif defined(__WATCOMC__) && !defined(__QNX__) - /* XXX Can't interrupt this sleep */ - Py_BEGIN_ALLOW_THREADS - delay((int)(secs * 1000 + 0.5)); /* delay() uses milliseconds */ - Py_END_ALLOW_THREADS #elif defined(MS_WINDOWS) { double millisecs = secs * 1000.0; @@ -1584,6 +1585,11 @@ } Py_END_ALLOW_THREADS } +#elif defined(__WATCOMC__) && !defined(__QNX__) + /* XXX Can't interrupt this sleep */ + Py_BEGIN_ALLOW_THREADS + delay((int)(secs * 1000 + 0.5)); /* delay() uses milliseconds */ + Py_END_ALLOW_THREADS #elif defined(PYOS_OS2) /* This Sleep *IS* Interruptable by Exceptions */ Py_BEGIN_ALLOW_THREADS diff -Nurwb -x __pycache__ -x OWbuild -x '*.dll' -x '*.exe' Python-3.3.2-original/PC/msvcrtmodule.c Python-3.3.2/PC/msvcrtmodule.c --- Python-3.3.2-original/PC/msvcrtmodule.c 2013-09-18 20:54:06.000000000 -0400 +++ Python-3.3.2/PC/msvcrtmodule.c 2013-09-22 16:59:45.000000000 -0400 @@ -24,6 +24,11 @@ #include #include +#ifdef __WATCOMC__ +#define _putch putch +#define _ungetch ungetch +#endif + #ifdef _MSC_VER #if _MSC_VER >= 1500 && _MSC_VER < 1600 #include diff -Nurwb -x __pycache__ -x OWbuild -x '*.dll' -x '*.exe' Python-3.3.2-original/Python/dynload_win.c Python-3.3.2/Python/dynload_win.c --- Python-3.3.2-original/Python/dynload_win.c 2013-09-18 20:54:11.000000000 -0400 +++ Python-3.3.2/Python/dynload_win.c 2013-09-19 21:46:19.000000000 -0400 @@ -26,6 +26,9 @@ NULL }; +#ifdef __WATCOMC__ +#define strcasecmp pystrcasecmp +#endif /* Case insensitive string compare, to avoid any dependencies on particular C RTL implementations */ diff -Nurwb -x __pycache__ -x OWbuild -x '*.dll' -x '*.exe' Python-3.3.2-original/Python/import.c Python-3.3.2/Python/import.c --- Python-3.3.2-original/Python/import.c 2013-09-18 20:54:11.000000000 -0400 +++ Python-3.3.2/Python/import.c 2013-09-19 21:47:24.000000000 -0400 @@ -20,8 +20,10 @@ #endif #ifdef MS_WINDOWS +#ifndef __WATCOMC__ /* for stat.st_mode */ typedef unsigned short mode_t; +#endif /* for _mkdir */ #include #endif diff -Nurwb -x __pycache__ -x OWbuild -x '*.dll' -x '*.exe' Python-3.3.2-original/Python/pythonrun.c Python-3.3.2/Python/pythonrun.c --- Python-3.3.2-original/Python/pythonrun.c 2013-09-18 20:54:11.000000000 -0400 +++ Python-3.3.2/Python/pythonrun.c 2013-09-19 21:50:48.000000000 -0400 @@ -32,8 +32,10 @@ #ifdef MS_WINDOWS #undef BYTE #include "windows.h" +#ifndef PATH_MAX #define PATH_MAX MAXPATHLEN #endif +#endif #ifndef Py_REF_DEBUG #define PRINT_TOTAL_REFS()