summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
Diffstat (limited to 'PC')
-rw-r--r--PC/config.c4
-rw-r--r--PC/errmap.h78
-rw-r--r--PC/errmap.mak5
-rw-r--r--PC/example_nt/example.c2
-rw-r--r--PC/example_nt/example.def2
-rw-r--r--PC/example_nt/example.vcproj15
-rw-r--r--PC/generrmap.c20
-rw-r--r--PC/py.icobin766 -> 23558 bytes
-rw-r--r--PC/pyc.icobin766 -> 23558 bytes
-rw-r--r--PC/pycon.icobin766 -> 23558 bytes
-rw-r--r--PC/pyconfig.h51
11 files changed, 158 insertions, 19 deletions
diff --git a/PC/config.c b/PC/config.c
index 75e1a3c..be11d3f 100644
--- a/PC/config.c
+++ b/PC/config.c
@@ -28,7 +28,6 @@ extern void init_sha(void);
extern void init_sha256(void);
extern void init_sha512(void);
extern void initstrop(void);
-extern void initstruct(void);
extern void inittime(void);
extern void initthread(void);
extern void initcStringIO(void);
@@ -53,6 +52,7 @@ extern void init_csv(void);
extern void init_sre(void);
extern void initparser(void);
extern void init_winreg(void);
+extern void init_struct(void);
extern void initdatetime(void);
extern void initfunctional(void);
extern void initzlib(void);
@@ -102,7 +102,6 @@ struct _inittab _PyImport_Inittab[] = {
{"_sha256", init_sha256},
{"_sha512", init_sha512},
{"strop", initstrop},
- {"struct", initstruct},
{"time", inittime},
#ifdef WITH_THREAD
{"thread", initthread},
@@ -131,6 +130,7 @@ struct _inittab _PyImport_Inittab[] = {
{"_sre", init_sre},
{"parser", initparser},
{"_winreg", init_winreg},
+ {"_struct", init_struct},
{"datetime", initdatetime},
{"functional", initfunctional},
diff --git a/PC/errmap.h b/PC/errmap.h
new file mode 100644
index 0000000..59aeea1
--- /dev/null
+++ b/PC/errmap.h
@@ -0,0 +1,78 @@
+/* Generated file. Do not edit. */
+int winerror_to_errno(int winerror)
+{
+ switch(winerror) {
+ case 2: return 2;
+ case 3: return 2;
+ case 4: return 24;
+ case 5: return 13;
+ case 6: return 9;
+ case 7: return 12;
+ case 8: return 12;
+ case 9: return 12;
+ case 10: return 7;
+ case 11: return 8;
+ case 15: return 2;
+ case 16: return 13;
+ case 17: return 18;
+ case 18: return 2;
+ case 19: return 13;
+ case 20: return 13;
+ case 21: return 13;
+ case 22: return 13;
+ case 23: return 13;
+ case 24: return 13;
+ case 25: return 13;
+ case 26: return 13;
+ case 27: return 13;
+ case 28: return 13;
+ case 29: return 13;
+ case 30: return 13;
+ case 31: return 13;
+ case 32: return 13;
+ case 33: return 13;
+ case 34: return 13;
+ case 35: return 13;
+ case 36: return 13;
+ case 53: return 2;
+ case 65: return 13;
+ case 67: return 2;
+ case 80: return 17;
+ case 82: return 13;
+ case 83: return 13;
+ case 89: return 11;
+ case 108: return 13;
+ case 109: return 32;
+ case 112: return 28;
+ case 114: return 9;
+ case 128: return 10;
+ case 129: return 10;
+ case 130: return 9;
+ case 132: return 13;
+ case 145: return 41;
+ case 158: return 13;
+ case 161: return 2;
+ case 164: return 11;
+ case 167: return 13;
+ case 183: return 17;
+ case 188: return 8;
+ case 189: return 8;
+ case 190: return 8;
+ case 191: return 8;
+ case 192: return 8;
+ case 193: return 8;
+ case 194: return 8;
+ case 195: return 8;
+ case 196: return 8;
+ case 197: return 8;
+ case 198: return 8;
+ case 199: return 8;
+ case 200: return 8;
+ case 201: return 8;
+ case 202: return 8;
+ case 206: return 2;
+ case 215: return 11;
+ case 1816: return 12;
+ default: return EINVAL;
+ }
+}
diff --git a/PC/errmap.mak b/PC/errmap.mak
new file mode 100644
index 0000000..646bcd0
--- /dev/null
+++ b/PC/errmap.mak
@@ -0,0 +1,5 @@
+errmap.h: generrmap.exe
+ .\generrmap.exe > errmap.h
+
+genermap.exe: generrmap.c
+ cl generrmap.c
diff --git a/PC/example_nt/example.c b/PC/example_nt/example.c
index 63682f1..46cb429 100644
--- a/PC/example_nt/example.c
+++ b/PC/example_nt/example.c
@@ -13,7 +13,7 @@ static PyMethodDef example_methods[] = {
{NULL, NULL}
};
-void
+PyMODINIT_FUNC
initexample(void)
{
Py_InitModule("example", example_methods);
diff --git a/PC/example_nt/example.def b/PC/example_nt/example.def
deleted file mode 100644
index 96b69a5..0000000
--- a/PC/example_nt/example.def
+++ /dev/null
@@ -1,2 +0,0 @@
-EXPORTS
- initexample
diff --git a/PC/example_nt/example.vcproj b/PC/example_nt/example.vcproj
index 0e6830b..7c0d4bb 100644
--- a/PC/example_nt/example.vcproj
+++ b/PC/example_nt/example.vcproj
@@ -39,12 +39,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/export:initexample"
- AdditionalDependencies="odbc32.lib odbccp32.lib python24.lib"
- OutputFile=".\Release/example.dll"
+ AdditionalDependencies="odbc32.lib odbccp32.lib python25.lib"
+ OutputFile=".\Release/example.pyd"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\PCbuild"
- ModuleDefinitionFile=".\example.def"
+ ModuleDefinitionFile=""
ProgramDatabaseFile=".\Release/example.pdb"
SubSystem="2"
ImportLibrary=".\Release/example.lib"
@@ -105,12 +105,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/export:initexample"
- AdditionalDependencies="odbc32.lib odbccp32.lib python24_d.lib"
- OutputFile=".\Debug/example_d.dll"
+ AdditionalDependencies="odbc32.lib odbccp32.lib python25_d.lib"
+ OutputFile=".\Debug/example_d.pyd"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\PCbuild"
- ModuleDefinitionFile=".\example.def"
+ ModuleDefinitionFile=""
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/example_d.pdb"
SubSystem="2"
@@ -171,9 +171,6 @@
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
</File>
- <File
- RelativePath="example.def">
- </File>
</Filter>
<Filter
Name="Header Files"
diff --git a/PC/generrmap.c b/PC/generrmap.c
new file mode 100644
index 0000000..2b25063
--- /dev/null
+++ b/PC/generrmap.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include <errno.h>
+
+/* Extract the mapping of Win32 error codes to errno */
+
+int main()
+{
+ int i;
+ printf("/* Generated file. Do not edit. */\n");
+ printf("int winerror_to_errno(int winerror)\n");
+ printf("{\n\tswitch(winerror) {\n");
+ for(i=1; i < 65000; i++) {
+ _dosmaperr(i);
+ if (errno == EINVAL)
+ continue;
+ printf("\t\tcase %d: return %d;\n", i, errno);
+ }
+ printf("\t\tdefault: return EINVAL;\n");
+ printf("\t}\n}\n");
+}
diff --git a/PC/py.ico b/PC/py.ico
index f714eea..114864a 100644
--- a/PC/py.ico
+++ b/PC/py.ico
Binary files differ
diff --git a/PC/pyc.ico b/PC/pyc.ico
index 2bf2e16..8155b99 100644
--- a/PC/pyc.ico
+++ b/PC/pyc.ico
Binary files differ
diff --git a/PC/pycon.ico b/PC/pycon.ico
index a54682d..7faa7ce 100644
--- a/PC/pycon.ico
+++ b/PC/pycon.ico
Binary files differ
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index 6c7846e..cb42131 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -14,6 +14,7 @@ the following #defines
MS_WIN64 - Code specific to the MS Win64 API
MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs)
MS_WINDOWS - Code specific to Windows, but all versions.
+MS_WINCE - Code specific to Windows CE
Py_ENABLE_SHARED - Code if the Python core is built as a DLL.
Also note that neither "_M_IX86" or "_MSC_VER" should be used for
@@ -27,6 +28,10 @@ MS_CORE_DLL.
*/
+#ifdef _WIN32_WCE
+#define MS_WINCE
+#endif
+
/* Visual Studio 2005 introduces deprecation warnings for
"insecure" and POSIX functions. The insecure functions should
be replaced by *_s versions (according to Microsoft); the
@@ -37,15 +42,23 @@ MS_CORE_DLL.
#define _CRT_SECURE_NO_DEPRECATE 1
#define _CRT_NONSTDC_NO_DEPRECATE 1
-#include <io.h>
+/* Windows CE does not have these */
+#ifndef MS_WINCE
+#define HAVE_IO_H
#define HAVE_SYS_UTIME_H
-#define HAVE_HYPOT
#define HAVE_TEMPNAM
#define HAVE_TMPFILE
#define HAVE_TMPNAM
#define HAVE_CLOCK
-#define HAVE_STRFTIME
#define HAVE_STRERROR
+#endif
+
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+
+#define HAVE_HYPOT
+#define HAVE_STRFTIME
#define DONT_HAVE_SIG_ALARM
#define DONT_HAVE_SIG_PAUSE
#define LONG_BIT 32
@@ -64,6 +77,11 @@ MS_CORE_DLL.
#define USE_SOCKET
#endif
+#ifdef MS_WINCE
+#define DONT_HAVE_SYS_STAT_H
+#define DONT_HAVE_ERRNO_H
+#endif
+
/* Compiler specific defines */
/* ------------------------------------------------------------------------*/
@@ -117,6 +135,11 @@ MS_CORE_DLL.
#endif
#endif /* MS_WIN64 */
+/* _W64 is not defined for VC6 or eVC4 */
+#ifndef _W64
+#define _W64
+#endif
+
/* Define like size_t, omitting the "unsigned" */
#ifdef MS_WIN64
typedef __int64 ssize_t;
@@ -139,6 +162,7 @@ typedef int pid_t;
#include <float.h>
#define Py_IS_NAN _isnan
#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))
+#define Py_IS_FINITE(X) _finite(X)
#endif /* _MSC_VER */
@@ -295,14 +319,21 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_LONG_LONG 8
+#define SIZEOF_DOUBLE 8
+#define SIZEOF_FLOAT 4
/* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200.
+ Microsoft eMbedded Visual C++ 4.0 has a version number of 1201 and doesn't
+ define these.
If some compiler does not provide them, modify the #if appropriately. */
#if defined(_MSC_VER)
-#if _MSC_VER > 1200
+#if _MSC_VER > 1201
#define HAVE_UINTPTR_T 1
#define HAVE_INTPTR_T 1
-#endif /* _MSC_VER > 1200 */
+#else
+/* VC6 & eVC4 don't support the C99 LL suffix for 64-bit integer literals */
+#define Py_LL(x) x##I64
+#endif /* _MSC_VER > 1200 */
#endif /* _MSC_VER */
#endif
@@ -397,7 +428,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* #define HAVE_ALTZONE */
/* Define if you have the putenv function. */
+#ifndef MS_WINCE
#define HAVE_PUTENV
+#endif
/* Define if your compiler supports function prototypes */
#define HAVE_PROTOTYPES
@@ -445,7 +478,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
#define HAVE_DYNAMIC_LOADING
/* Define if you have ftime. */
+#ifndef MS_WINCE
#define HAVE_FTIME
+#endif
/* Define if you have getpeername. */
#define HAVE_GETPEERNAME
@@ -454,7 +489,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* #undef HAVE_GETPGRP */
/* Define if you have getpid. */
+#ifndef MS_WINCE
#define HAVE_GETPID
+#endif
/* Define if you have gettimeofday. */
/* #undef HAVE_GETTIMEOFDAY */
@@ -511,13 +548,17 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* #undef HAVE_WAITPID */
/* Define to 1 if you have the `wcscoll' function. */
+#ifndef MS_WINCE
#define HAVE_WCSCOLL 1
+#endif
/* Define if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define if you have the <fcntl.h> header file. */
+#ifndef MS_WINCE
#define HAVE_FCNTL_H 1
+#endif
/* Define if you have the <stdarg.h> prototypes. */
#define HAVE_STDARG_PROTOTYPES