Skip to content

Commit 1bc716f

Browse files
committed
Added PC files from Jim Ahlstrom.
1 parent c012547 commit 1bc716f

33 files changed

+17716
-21
lines changed

PC/config.c

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,10 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2929

3030
#include "Python.h"
3131

32-
#ifndef MS_WIN16
33-
/* Assume all 32-bit platforms come standard with a WINSOCK library */
34-
#define USE_SOCKET
35-
#define USE_SELECT
36-
#endif
37-
3832
extern void initarray();
3933
extern void initaudioop();
4034
extern void initbinascii();
35+
extern void initcmath();
4136
extern void initenvironment();
4237
extern void initimageop();
4338
extern void initmath();
@@ -47,8 +42,8 @@ extern void initnt();
4742
extern void initregex();
4843
extern void initrgbimg();
4944
extern void initrotor();
50-
extern void initselect();
5145
extern void initsignal();
46+
extern void initselect();
5247
extern void init_socket();
5348
extern void initsoundex();
5449
extern void initstrop();
@@ -60,16 +55,14 @@ extern void inittime();
6055
extern void PyMarshal_Init();
6156
extern void initimp();
6257

63-
struct {
64-
char *name;
65-
void (*initfunc)();
66-
} inittab[] = {
58+
struct _inittab inittab[] = {
6759

6860
{"array", initarray},
6961
#ifdef M_I386
7062
{"audioop", initaudioop},
7163
#endif
7264
{"binascii", initbinascii},
65+
{"cmath", initcmath},
7366
{"environment", initenvironment},
7467
{"imageop", initimageop},
7568
{"math", initmath},
@@ -79,12 +72,10 @@ struct {
7972
{"regex", initregex},
8073
{"rgbimg", initrgbimg},
8174
{"rotor", initrotor},
82-
#ifdef USE_SELECT
83-
{"select", initselect},
84-
#endif
8575
{"signal", initsignal},
8676
#ifdef USE_SOCKET
8777
{"_socket", init_socket},
78+
{"select", initselect},
8879
#endif
8980
{"soundex", initsoundex},
9081
{"strop", initstrop},

PC/config.h

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,31 @@ standard part of the Python distribution.
2424
#define HAVE_HYPOT
2525
#define DONT_HAVE_SIG_ALARM
2626
#define DONT_HAVE_SIG_PAUSE
27+
#define LONG_BIT 32
2728

2829
/* Microsoft C defines _MSC_VER */
2930

3031
#if defined(_MSC_VER) && _MSC_VER > 850
31-
/* Start of defines for NT using VC++ 2.0 and up */
32-
#define NT
32+
/* Start of defines for MS_WIN32 using VC++ 2.0 and up */
33+
#define NT /* NT is obsolete - please use MS_WIN32 instead */
34+
#define MS_WIN32
35+
#define MS_WINDOWS
3336
#ifdef _M_IX86
3437
#define COMPILER "[MSC 32 bit (Intel)]"
3538
#else
3639
#define COMPILER "[MSC (Unknown)]"
3740
#endif
38-
#define PYTHONPATH "c:\\python\\lib"
41+
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\win"
3942
typedef int pid_t;
43+
#define WORD_BIT 32
4044
#pragma warning(disable:4113)
4145
#define hypot _hypot
4246
#include <stdio.h>
4347
#define HAVE_CLOCK
4448
#define HAVE_STRFTIME
4549
#define NT_THREADS
4650
#define WITH_THREAD
51+
#define _COMPLEX_DEFINED
4752
#ifndef NETSCAPE_PI
4853
#define USE_SOCKET
4954
#endif
@@ -53,15 +58,20 @@ typedef int pid_t;
5358
#ifdef USE_DL_EXPORT
5459
#define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
5560
#endif
56-
#endif /* NT */
61+
#endif /* MS_WIN32 */
5762

5863
#if defined(_MSC_VER) && _MSC_VER <= 850
5964
/* Start of defines for 16-bit Windows using VC++ 1.5 */
6065
#define COMPILER "[MSC 16-bit]"
66+
#ifdef _WINDOWS
6167
#define MS_WIN16
62-
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\dos_8x3"
68+
#define MS_WINDOWS
69+
#endif
70+
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\win;c:\\python\\lib\\dos_8x3"
6371
#define IMPORT_8x3_NAMES
6472
typedef int pid_t;
73+
#define WORD_BIT 16
74+
#define _COMPLEX_DEFINED
6575
#pragma warning(disable:4113)
6676
#define memcpy memmove /* memcpy dangerous pointer wrap in Win 3.1 */
6777
#define hypot _hypot
@@ -99,13 +109,30 @@ int sscanf(const char *, const char *, ...);
99109
/* The Watcom compiler defines __WATCOMC__ */
100110
#ifdef __WATCOMC__
101111
#define COMPILER "[Watcom]"
102-
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\dos_8x3"
112+
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\win;c:\\python\\lib\\dos_8x3"
103113
#define IMPORT_8x3_NAMES
104114
#include <ctype.h>
105115
#include <direct.h>
106116
typedef int mode_t;
107117
typedef int uid_t;
108118
typedef int gid_t;
119+
typedef int pid_t;
120+
#if defined(__NT__)
121+
#define NT /* NT is obsolete - please use MS_WIN32 instead */
122+
#define MS_WIN32
123+
#define MS_WINDOWS
124+
#define NT_THREADS
125+
#define USE_SOCKET
126+
#define WITH_THREAD
127+
#elif defined(__WINDOWS__)
128+
#define MS_WIN16
129+
#define MS_WINDOWS
130+
#endif
131+
#ifdef M_I386
132+
#define WORD_BIT 32
133+
#else
134+
#define WORD_BIT 16
135+
#endif
109136
#define VA_LIST_IS_ARRAY
110137
#define HAVE_CLOCK
111138
#define HAVE_STRFTIME
@@ -117,7 +144,7 @@ typedef int gid_t;
117144
/* The Borland compiler defines __BORLANDC__ */
118145
#ifdef __BORLANDC__
119146
#define COMPILER "[Borland]"
120-
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\dos_8x3"
147+
#define PYTHONPATH "c:\\python\\lib;c:\\python\\lib\\win;c:\\python\\lib\\dos_8x3"
121148
#define IMPORT_8x3_NAMES
122149
#define HAVE_CLOCK
123150
#define HAVE_STRFTIME

PC/makesrc.exe

25 KB
Binary file not shown.

PC/pyth_w31.def

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
NAME
2+
EXETYPE WINDOWS
3+
CODE PRELOAD MOVABLE DISCARDABLE
4+
DATA PRELOAD MOVABLE
5+
HEAPSIZE 4096

PC/python.def

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
EXPORTS
2+
Py_GetCopyright
3+
Py_GetVersion
4+
Py_FindMethod
5+
_PyObject_New
6+
_PyString_Resize
7+
PySys_SetArgv
8+
PyObject_Cmp
9+
PyObject_CallObject
10+
PyObject_CallFunction
11+
PyObject_CallMethod
12+
PyObject_Type
13+
PyObject_Length
14+
PyObject_GetItem
15+
PyObject_SetItem
16+
PyNumber_Check
17+
PyNumber_Add
18+
PyNumber_Subtract
19+
PyNumber_Multiply
20+
PyNumber_Divide
21+
PyNumber_Remainder
22+
PyNumber_Divmod
23+
PyNumber_Power
24+
PyNumber_Negative
25+
PyNumber_Positive
26+
PyNumber_Absolute
27+
PyNumber_Invert
28+
PyNumber_Lshift
29+
PyNumber_Rshift
30+
PyNumber_And
31+
PyNumber_Xor
32+
PyNumber_Or
33+
PyNumber_Int
34+
PyNumber_Long
35+
PyNumber_Float
36+
PySequence_Check
37+
PySequence_Concat
38+
PySequence_Repeat
39+
PySequence_GetItem
40+
PySequence_GetSlice
41+
PySequence_SetItem
42+
PySequence_SetSlice
43+
PySequence_Tuple
44+
PySequence_Count
45+
PySequence_In
46+
PySequence_Index
47+
PyMapping_Check
48+
PyMapping_Length
49+
PyMapping_HasKeyString
50+
PyMapping_HasKey
51+
PyMapping_GetItemString
52+
PyMapping_SetItemString
53+
PyAccess_FromValue
54+
PyAccess_AsValue
55+
PyAccess_SetValue
56+
PyAccess_SetOwner
57+
PyAccess_Clone
58+
PyAccess_HasValue
59+
PyEval_CallObject
60+
PyEval_GetBuiltins
61+
PyEval_GetGlobals
62+
PyEval_GetLocals
63+
PyEval_GetOwner
64+
PyEval_GetFrame
65+
PyEval_GetRestricted
66+
Py_FlushLine
67+
Py_AddPendingCall
68+
Py_MakePendingCalls
69+
PyEval_InitThreads
70+
PyEval_SaveThread
71+
PyEval_RestoreThread
72+
PyArg_GetObject
73+
PyArg_GetLong
74+
PyArg_GetShort
75+
PyArg_GetFloat
76+
PyArg_GetString
77+
PyClass_New
78+
PyInstance_New
79+
PyMethod_New
80+
PyMethod_Function
81+
PyMethod_Self
82+
PyMethod_Class
83+
PyClass_IsSubclass
84+
PyNode_Compile
85+
PyCode_New
86+
PyErr_SetNone
87+
PyErr_SetObject
88+
PyErr_SetString
89+
PyErr_Occurred
90+
PyErr_Clear
91+
PyErr_Fetch
92+
PyErr_Restore
93+
PyErr_BadArgument
94+
PyErr_NoMemory
95+
PyErr_SetFromErrno
96+
PyErr_BadInternalCall
97+
PyErr_CheckSignals
98+
PyEval_EvalCode
99+
PyFile_FromFile
100+
PyFile_FromString
101+
PyFile_SetBufSize
102+
PyFile_AsFile
103+
PyFile_Name
104+
PyFile_GetLine
105+
PyFloat_FromDouble
106+
PyFloat_AsDouble
107+
PyFrame_BlockSetup
108+
PyFrame_BlockPop
109+
PyFrame_LocalsToFast
110+
PyFrame_FastToLocals
111+
PyFunction_New
112+
PyFunction_GetCode
113+
PyFunction_GetGlobals
114+
PyFunction_GetDefaults
115+
PyFunction_SetDefaults
116+
PyGrammar_FindDFA
117+
PyGrammar_LabelRepr
118+
PyGrammar_AddAccelerators
119+
PyImport_GetMagicNumber
120+
PyImport_ExecCodeModule
121+
PyImport_GetModuleDict
122+
PyImport_AddModule
123+
PyImport_ImportModule
124+
PyImport_ReloadModule
125+
PyImport_Cleanup
126+
PyInt_FromLong
127+
PyInt_AsLong
128+
PyOS_InterruptOccurred
129+
PyOS_InitInterrupts
130+
PyList_New
131+
PyList_Size
132+
PyList_GetItem
133+
PyList_SetItem
134+
PyList_Insert
135+
PyList_Append
136+
PyList_GetSlice
137+
PyList_SetSlice
138+
PyList_Sort
139+
PyList_Reverse
140+
PyList_AsTuple
141+
PyLong_FromLong
142+
PyLong_FromDouble
143+
PyLong_AsLong
144+
PyLong_AsDouble
145+
PyLong_FromString
146+
PyDict_New
147+
PyDict_GetItem
148+
PyDict_SetItem
149+
PyDict_DelItem
150+
PyDict_Clear
151+
PyDict_Keys
152+
PyDict_Values
153+
PyDict_Items
154+
PyDict_Size
155+
PyDict_GetItemString
156+
PyDict_SetItemString
157+
PyDict_DelItemString
158+
PyMarshal_WriteLongToFile
159+
PyMarshal_WriteObjectToFile
160+
PyMarshal_ReadLongFromFile
161+
PyMarshal_ReadObjectFromFile
162+
PyMarshal_ReadObjectFromString
163+
PyCFunction_GetFunction
164+
PyCFunction_GetSelf
165+
PyCFunction_GetFlags
166+
PyArg_Parse
167+
PyArg_ParseTuple
168+
Py_BuildValue
169+
Py_VaBuildValue
170+
Py_InitModule4
171+
PyModule_New
172+
PyModule_GetDict
173+
PyModule_GetName
174+
PyNode_New
175+
PyNode_AddChild
176+
PyNode_Free
177+
PyObject_Print
178+
PyObject_Repr
179+
PyObject_Str
180+
PyObject_Compare
181+
PyObject_GetAttrString
182+
PyObject_SetAttrString
183+
PyObject_HasAttrString
184+
PyObject_GetAttr
185+
PyObject_SetAttr
186+
PyObject_Hash
187+
PyObject_IsTrue
188+
PyCallable_Check
189+
PyParser_ParseString
190+
PyParser_ParseFile
191+
Py_FatalError
192+
Py_Initialize
193+
PyRun_AnyFile
194+
PyRun_SimpleString
195+
PyRun_SimpleFile
196+
PyRun_InteractiveOne
197+
PyRun_InteractiveLoop
198+
PyParser_SimpleParseString
199+
PyParser_SimpleParseFile
200+
PyRun_String
201+
PyRun_File
202+
Py_CompileString
203+
PyErr_Print
204+
Py_AtExit
205+
Py_Exit
206+
Py_Cleanup
207+
PyRange_New
208+
PyString_FromStringAndSize
209+
PyString_FromString
210+
PyString_Size
211+
PyString_AsString
212+
PyString_Concat
213+
PyString_ConcatAndDel
214+
PyString_Format
215+
PyMember_Get
216+
PyMember_Set
217+
PySys_GetObject
218+
PySys_SetObject
219+
PySys_GetFile
220+
PySys_Init
221+
PyToken_OneChar
222+
PyToken_TwoChars
223+
PyTraceBack_Here
224+
PyTraceBack_Fetch
225+
PyTraceBack_Store
226+
PyTraceBack_Print
227+
PyTuple_New
228+
PyTuple_Size
229+
PyTuple_GetItem
230+
PyTuple_SetItem
231+
PyTuple_GetSlice

0 commit comments

Comments
 (0)