Merge lp:~marcustomlinson/ecspython/fix_float_params into lp:ecspython
- fix_float_params
- Merge into trunk
Proposed by
Marcus Tomlinson
Status: | Merged |
---|---|
Approved by: | Marcus Tomlinson |
Approved revision: | 20 |
Merged at revision: | 10 |
Proposed branch: | lp:~marcustomlinson/ecspython/fix_float_params |
Merge into: | lp:ecspython |
Diff against target: |
2508 lines (+299/-1667) 14 files modified
CMakeLists.txt (+2/-5) example/main.cpp (+75/-18) include/EcsPython.h (+17/-31) include/dspatch/DspThread.h (+1/-1) include/dspatch/DspThreadNull.h (+2/-2) include/dspatch/DspThreadUnix.h (+16/-8) include/dspatch/DspThreadWin.h (+8/-7) include/ecspython/EcsMacros.h (+121/-28) readme_windows.txt (+15/-0) src/EcsMacros.cpp (+32/-26) src/EcsPython.cpp (+10/-14) win_fix/Python27/pyconfig.h (+0/-756) win_fix/Python33/pyconfig.h (+0/-765) win_fix/readme.txt (+0/-6) |
To merge this branch: | bzr merge lp:~marcustomlinson/ecspython/fix_float_params |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marcus Tomlinson | Pending | ||
Review via email: mp+243568@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 12. By Marcus Tomlinson
-
Added support for char* and void* return values
- 13. By Marcus Tomlinson
-
missing "else"
- 14. By Marcus Tomlinson
-
Python class functors return a pointer to the C++ class
- 15. By Marcus Tomlinson
-
code formatting
- 16. By Marcus Tomlinson
-
Include char* in example
- 17. By Marcus Tomlinson
-
Fixed Windows stuff
- 18. By Marcus Tomlinson
-
Allow creation of user class types from Python
- 19. By Marcus Tomlinson
-
Added readme_windows.txt for Windows users
- 20. By Marcus Tomlinson
-
Cleaned up example code
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-01-26 11:00:54 +0000 | |||
3 | +++ CMakeLists.txt 2014-12-05 19:42:33 +0000 | |||
4 | @@ -1,11 +1,9 @@ | |||
5 | 1 | cmake_minimum_required(VERSION 2.8) | 1 | cmake_minimum_required(VERSION 2.8) |
6 | 2 | 2 | ||
7 | 3 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -Wall -Wextra") | ||
8 | 4 | |||
9 | 3 | project(EcsPython) | 5 | project(EcsPython) |
10 | 4 | 6 | ||
11 | 5 | add_definitions( | ||
12 | 6 | -fpermissive | ||
13 | 7 | ) | ||
14 | 8 | |||
15 | 9 | add_subdirectory(example) | 7 | add_subdirectory(example) |
16 | 10 | 8 | ||
17 | 11 | if(UNIX) | 9 | if(UNIX) |
18 | @@ -13,7 +11,6 @@ | |||
19 | 13 | endif(UNIX) | 11 | endif(UNIX) |
20 | 14 | 12 | ||
21 | 15 | if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | 13 | if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") |
22 | 16 | add_definitions(-DECS_EXPORT) | ||
23 | 17 | set(PYTHON_LIBRARIES "C:/Python27/libs/python27.lib") | 14 | set(PYTHON_LIBRARIES "C:/Python27/libs/python27.lib") |
24 | 18 | set(PYTHON_INCLUDE_DIRS "C:/Python27/include") | 15 | set(PYTHON_INCLUDE_DIRS "C:/Python27/include") |
25 | 19 | endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | 16 | endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") |
26 | 20 | 17 | ||
27 | === modified file 'example/main.cpp' | |||
28 | --- example/main.cpp 2014-01-25 13:13:29 +0000 | |||
29 | +++ example/main.cpp 2014-12-05 19:42:33 +0000 | |||
30 | @@ -1,6 +1,6 @@ | |||
31 | 1 | /************************************************************************ | 1 | /************************************************************************ |
32 | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ |
34 | 3 | Copyright (c) 2012-2013 Marcus Tomlinson | 3 | Copyright (c) 2012-2014 Marcus Tomlinson |
35 | 4 | 4 | ||
36 | 5 | This file is part of EcsPython. | 5 | This file is part of EcsPython. |
37 | 6 | 6 | ||
38 | @@ -50,11 +50,17 @@ | |||
39 | 50 | return true; | 50 | return true; |
40 | 51 | } | 51 | } |
41 | 52 | 52 | ||
43 | 53 | void ShowLots( unsigned long count, std::string message ) | 53 | float ShowDouble( double message ) |
44 | 54 | { | ||
45 | 55 | std::cout << message; | ||
46 | 56 | return (float)message; | ||
47 | 57 | } | ||
48 | 58 | |||
49 | 59 | void ShowLots( unsigned long count, char* message ) | ||
50 | 54 | { | 60 | { |
51 | 55 | for( unsigned int i = 0; i < count; i++ ) | 61 | for( unsigned int i = 0; i < count; i++ ) |
52 | 56 | { | 62 | { |
54 | 57 | std::cout << message.c_str(); | 63 | std::cout << message; |
55 | 58 | } | 64 | } |
56 | 59 | lastMessage = message; | 65 | lastMessage = message; |
57 | 60 | } | 66 | } |
58 | @@ -64,16 +70,43 @@ | |||
59 | 64 | return lastMessage; | 70 | return lastMessage; |
60 | 65 | } | 71 | } |
61 | 66 | 72 | ||
62 | 73 | void ShowPtr( void* thiz ) | ||
63 | 74 | { | ||
64 | 75 | ((Simple*)thiz)->Show("Hey! This is coming from a pointer :)"); | ||
65 | 76 | } | ||
66 | 77 | |||
67 | 67 | private: | 78 | private: |
68 | 68 | std::string lastMessage; | 79 | std::string lastMessage; |
69 | 69 | }; | 80 | }; |
70 | 70 | 81 | ||
71 | 82 | // Simple Class Factory | ||
72 | 83 | // ==================== | ||
73 | 84 | class SimpleFactory | ||
74 | 85 | { | ||
75 | 86 | public: | ||
76 | 87 | void* NewSimple( std::string firstMessage ) | ||
77 | 88 | { | ||
78 | 89 | return new Simple( firstMessage ); | ||
79 | 90 | } | ||
80 | 91 | |||
81 | 92 | void DeleteSimple( void* simple ) | ||
82 | 93 | { | ||
83 | 94 | delete ( ( Simple* )simple ); | ||
84 | 95 | } | ||
85 | 96 | }; | ||
86 | 97 | |||
87 | 71 | // Register Classes + Methods | 98 | // Register Classes + Methods |
88 | 72 | // ========================== | 99 | // ========================== |
93 | 73 | ECS_REGISTER_CLASS( Simple ); | 100 | ECS_REGISTER_CLASS( Simple ) |
94 | 74 | ECS_REGISTER_METHOD_RETURN( Simple, Show, bool, std::string ); | 101 | ECS_REGISTER_METHOD_RETURN( Simple, Show, bool, std::string ) |
95 | 75 | ECS_REGISTER_METHOD_VOID( Simple, ShowLots, unsigned long, std::string ); | 102 | ECS_REGISTER_METHOD_RETURN( Simple, ShowDouble, float, double ) |
96 | 76 | ECS_REGISTER_METHOD_RETURN( Simple, GetLastMessage, std::string ); | 103 | ECS_REGISTER_METHOD_VOID( Simple, ShowLots, unsigned long, char* ) |
97 | 104 | ECS_REGISTER_METHOD_RETURN( Simple, GetLastMessage, std::string ) | ||
98 | 105 | ECS_REGISTER_METHOD_VOID( Simple, ShowPtr, void* ) | ||
99 | 106 | |||
100 | 107 | ECS_REGISTER_CLASS( SimpleFactory ) | ||
101 | 108 | ECS_REGISTER_METHOD_RETURN( SimpleFactory, NewSimple, void*, std::string ) | ||
102 | 109 | ECS_REGISTER_METHOD_VOID( SimpleFactory, DeleteSimple, void* ) | ||
103 | 77 | 110 | ||
104 | 78 | //================================================================================================= | 111 | //================================================================================================= |
105 | 79 | 112 | ||
106 | @@ -85,42 +118,66 @@ | |||
107 | 85 | // ====================== | 118 | // ====================== |
108 | 86 | Ecs_Init_Simple(); | 119 | Ecs_Init_Simple(); |
109 | 87 | Ecs_Init_Simple_Show(); | 120 | Ecs_Init_Simple_Show(); |
110 | 121 | Ecs_Init_Simple_ShowDouble(); | ||
111 | 88 | Ecs_Init_Simple_ShowLots(); | 122 | Ecs_Init_Simple_ShowLots(); |
112 | 89 | Ecs_Init_Simple_GetLastMessage(); | 123 | Ecs_Init_Simple_GetLastMessage(); |
113 | 124 | Ecs_Init_Simple_ShowPtr(); | ||
114 | 125 | |||
115 | 126 | Ecs_Init_SimpleFactory(); | ||
116 | 127 | Ecs_Init_SimpleFactory_NewSimple(); | ||
117 | 128 | Ecs_Init_SimpleFactory_DeleteSimple(); | ||
118 | 90 | 129 | ||
119 | 91 | // Initialize EcsPython | 130 | // Initialize EcsPython |
120 | 92 | // ==================== | 131 | // ==================== |
121 | 93 | Ecs_Initialize(); | 132 | Ecs_Initialize(); |
122 | 94 | 133 | ||
123 | 95 | // Create New Class Instance | ||
124 | 96 | // ========================= | ||
125 | 97 | Simple* newSimple = new Simple( "(first message)" ); | ||
126 | 98 | 134 | ||
130 | 99 | // Expose Class Instance To Python | 135 | // Create And Expose Class Instance To Python |
131 | 100 | // =============================== | 136 | // ========================================== |
132 | 101 | Ecs_Expose_Object( newSimple, "newSimple" ); | 137 | Simple newSimple( "(first message)" ); |
133 | 138 | Ecs_Expose_Object( &newSimple, "newSimple" ); | ||
134 | 102 | 139 | ||
135 | 103 | // Use Exposed Class Instance From Python | 140 | // Use Exposed Class Instance From Python |
136 | 104 | // ====================================== | 141 | // ====================================== |
137 | 105 | Ecs_Python_Cmd( "print( newSimple.GetLastMessage() )" ); | 142 | Ecs_Python_Cmd( "print( newSimple.GetLastMessage() )" ); |
138 | 106 | 143 | ||
139 | 144 | Ecs_Python_Cmd( "newSimple.Show( 'my favorite number is ' )" ); | ||
140 | 145 | Ecs_Python_Cmd( "newSimple.ShowDouble( 5.9982 )" ); | ||
141 | 146 | Ecs_Python_Cmd( "print('')" ); | ||
142 | 147 | |||
143 | 148 | Ecs_Python_Cmd( "newSimple.ShowPtr( newSimple() )" ); | ||
144 | 149 | Ecs_Python_Cmd( "print('')" ); | ||
145 | 150 | |||
146 | 107 | Ecs_Python_Cmd( "state = newSimple.Show( 'hello' )" ); | 151 | Ecs_Python_Cmd( "state = newSimple.Show( 'hello' )" ); |
148 | 108 | Ecs_Python_Cmd( "if state == True: \n\t print( ' there,' )" ); | 152 | Ecs_Python_Cmd( "if state == True:\n\tprint( ' there,' )" ); |
149 | 109 | 153 | ||
150 | 110 | Ecs_Python_Cmd( "newSimple.ShowLots( 5, 'again and ' )" ); | 154 | Ecs_Python_Cmd( "newSimple.ShowLots( 5, 'again and ' )" ); |
151 | 111 | 155 | ||
152 | 112 | Ecs_Python_Cmd( "newSimple.Show( 'once more.' )" ); | 156 | Ecs_Python_Cmd( "newSimple.Show( 'once more.' )" ); |
153 | 113 | Ecs_Python_Cmd( "print('')" ); | 157 | Ecs_Python_Cmd( "print('')" ); |
154 | 114 | 158 | ||
159 | 115 | // Use Class Instance From C++ | 159 | // Use The Class Instance From C++ |
160 | 116 | // =========================== | 160 | // =============================== |
161 | 117 | std::cout << newSimple->GetLastMessage().c_str(); | 161 | std::cout << "Ok, " << newSimple.GetLastMessage().c_str() << std::endl; |
162 | 118 | getchar(); | 162 | |
163 | 163 | |||
164 | 164 | // Create And Expose Factory To Python | ||
165 | 165 | // =================================== | ||
166 | 166 | SimpleFactory simpleFactory; | ||
167 | 167 | Ecs_Expose_Object( &simpleFactory, "simpleFactory" ); | ||
168 | 168 | |||
169 | 169 | // Create A New Class Instance From Python | ||
170 | 170 | // ======================================= | ||
171 | 171 | Ecs_Python_Cmd( "anotherSimple = Simple( simpleFactory.NewSimple( '\\'Allo ' ) )" ); | ||
172 | 172 | Ecs_Python_Cmd( "print( anotherSimple.GetLastMessage() + '\\'Allo!')" ); | ||
173 | 173 | Ecs_Python_Cmd( "simpleFactory.DeleteSimple( anotherSimple() )" ); | ||
174 | 174 | |||
175 | 119 | 175 | ||
176 | 120 | // Finalize EcsPython | 176 | // Finalize EcsPython |
177 | 121 | // ================== | 177 | // ================== |
178 | 122 | Ecs_Finalize(); | 178 | Ecs_Finalize(); |
179 | 123 | 179 | ||
180 | 180 | getchar(); | ||
181 | 124 | return 0; | 181 | return 0; |
182 | 125 | } | 182 | } |
183 | 126 | 183 | ||
184 | 127 | 184 | ||
185 | === modified file 'include/EcsPython.h' | |||
186 | --- include/EcsPython.h 2014-01-25 13:13:29 +0000 | |||
187 | +++ include/EcsPython.h 2014-12-05 19:42:33 +0000 | |||
188 | @@ -1,6 +1,6 @@ | |||
189 | 1 | /************************************************************************ | 1 | /************************************************************************ |
190 | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ |
192 | 3 | Copyright (c) 2012-2013 Marcus Tomlinson | 3 | Copyright (c) 2012-2014 Marcus Tomlinson |
193 | 4 | 4 | ||
194 | 5 | This file is part of EcsPython. | 5 | This file is part of EcsPython. |
195 | 6 | 6 | ||
196 | @@ -32,22 +32,8 @@ | |||
197 | 32 | #ifndef ECSPYTHON_H | 32 | #ifndef ECSPYTHON_H |
198 | 33 | #define ECSPYTHON_H | 33 | #define ECSPYTHON_H |
199 | 34 | 34 | ||
214 | 35 | #ifdef _WIN32 | 35 | #include <dspatch/DspThread.h> |
201 | 36 | |||
202 | 37 | #ifdef ECS_EXPORT | ||
203 | 38 | #define DLLPORT __declspec(dllexport) | ||
204 | 39 | #else | ||
205 | 40 | #define DLLPORT __declspec(dllimport) | ||
206 | 41 | #endif | ||
207 | 42 | |||
208 | 43 | #else | ||
209 | 44 | |||
210 | 45 | #define DLLPORT | ||
211 | 46 | |||
212 | 47 | #endif | ||
213 | 48 | |||
215 | 49 | #include <ecspython/EcsMacros.h> | 36 | #include <ecspython/EcsMacros.h> |
216 | 50 | #include <dspatch/DspThread.h> | ||
217 | 51 | 37 | ||
218 | 52 | struct PyMethodDef; | 38 | struct PyMethodDef; |
219 | 53 | 39 | ||
220 | @@ -55,7 +41,7 @@ | |||
221 | 55 | // EcsPython Globals | 41 | // EcsPython Globals |
222 | 56 | // ================= | 42 | // ================= |
223 | 57 | 43 | ||
225 | 58 | struct DLLEXPORT EcsClass | 44 | struct EcsClass |
226 | 59 | { | 45 | { |
227 | 60 | EcsClass( std::string newPyClassName, const std::type_info& newPyClassType ) | 46 | EcsClass( std::string newPyClassName, const std::type_info& newPyClassType ) |
228 | 61 | : pyClassName( newPyClassName ), | 47 | : pyClassName( newPyClassName ), |
229 | @@ -65,7 +51,7 @@ | |||
230 | 65 | const std::type_info& pyClassType; | 51 | const std::type_info& pyClassType; |
231 | 66 | }; | 52 | }; |
232 | 67 | 53 | ||
234 | 68 | struct DLLEXPORT EcsObject | 54 | struct EcsObject |
235 | 69 | { | 55 | { |
236 | 70 | EcsObject( char* newPyObject, std::string newPyClassName, std::string newPyObjectName ) | 56 | EcsObject( char* newPyObject, std::string newPyClassName, std::string newPyObjectName ) |
237 | 71 | : pyObject( newPyObject ), | 57 | : pyObject( newPyObject ), |
238 | @@ -77,54 +63,54 @@ | |||
239 | 77 | std::string pyObjectName; | 63 | std::string pyObjectName; |
240 | 78 | }; | 64 | }; |
241 | 79 | 65 | ||
247 | 80 | DLLPORT extern DspMutex EcsPythonCmdMutex; // Mutex for thread-safe python calls | 66 | extern DspMutex EcsPythonCmdMutex; // Mutex for thread-safe python calls |
248 | 81 | DLLPORT extern std::vector< EcsClass* > EcsPythonClassesDict; // C++ class dictionary | 67 | extern std::vector< EcsClass* > EcsPythonClassesDict; // C++ class dictionary |
249 | 82 | DLLPORT extern std::string EcsPythonClassesDef; // Python definition string for C++ classes | 68 | extern std::string EcsPythonClassesDef; // Python definition string for C++ classes |
250 | 83 | DLLPORT extern std::vector< PyMethodDef > EcsPythonMethods; // Methods for EcsPython python module | 69 | extern std::vector< PyMethodDef > EcsPythonMethods; // Methods for EcsPython python module |
251 | 84 | DLLPORT extern std::vector< EcsObject* > EcsExposedObjects; // C++ objects exposed to Python | 70 | extern std::vector< EcsObject* > EcsExposedObjects; // C++ objects exposed to Python |
252 | 85 | 71 | ||
253 | 86 | #if PY_MAJOR_VERSION >= 3 | 72 | #if PY_MAJOR_VERSION >= 3 |
255 | 87 | DLLPORT extern struct PyModuleDef EcsPythonModule; // EcsPython python module | 73 | extern struct PyModuleDef EcsPythonModule; // EcsPython python module |
256 | 88 | #endif | 74 | #endif |
257 | 89 | 75 | ||
258 | 90 | //================================================================================================= | 76 | //================================================================================================= |
259 | 91 | // Initialize EcsPython | 77 | // Initialize EcsPython |
260 | 92 | // ==================== | 78 | // ==================== |
261 | 93 | 79 | ||
263 | 94 | DLLEXPORT void Ecs_Initialize(); | 80 | void Ecs_Initialize(); |
264 | 95 | 81 | ||
265 | 96 | //------------------------------------------------------------------------------------------------- | 82 | //------------------------------------------------------------------------------------------------- |
266 | 97 | // Finalize EcsPython | 83 | // Finalize EcsPython |
267 | 98 | // ================== | 84 | // ================== |
268 | 99 | 85 | ||
270 | 100 | DLLEXPORT void Ecs_Finalize(); | 86 | void Ecs_Finalize(); |
271 | 101 | 87 | ||
272 | 102 | //------------------------------------------------------------------------------------------------- | 88 | //------------------------------------------------------------------------------------------------- |
273 | 103 | // Execute Python Command | 89 | // Execute Python Command |
274 | 104 | // ====================== | 90 | // ====================== |
275 | 105 | 91 | ||
277 | 106 | DLLEXPORT void Ecs_Python_Cmd( std::string pythonCmdString ); | 92 | void Ecs_Python_Cmd( std::string pythonCmdString ); |
278 | 107 | 93 | ||
279 | 108 | //------------------------------------------------------------------------------------------------- | 94 | //------------------------------------------------------------------------------------------------- |
280 | 109 | // Execute Python File | 95 | // Execute Python File |
281 | 110 | // =================== | 96 | // =================== |
282 | 111 | 97 | ||
284 | 112 | DLLEXPORT void Ecs_Python_File( std::string pythonScriptPath ); | 98 | void Ecs_Python_File( std::string pythonScriptPath ); |
285 | 113 | 99 | ||
286 | 114 | //------------------------------------------------------------------------------------------------- | 100 | //------------------------------------------------------------------------------------------------- |
287 | 115 | // Get Object Value From Python | 101 | // Get Object Value From Python |
288 | 116 | // ============================ | 102 | // ============================ |
289 | 117 | 103 | ||
291 | 118 | DLLEXPORT std::string Ecs_Get_Value( std::string pyObjectName ); | 104 | std::string Ecs_Get_Value( std::string pyObjectName ); |
292 | 119 | 105 | ||
293 | 120 | //------------------------------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------------------------------- |
294 | 121 | // Expose Class Instance To Python | 107 | // Expose Class Instance To Python |
295 | 122 | // =============================== | 108 | // =============================== |
296 | 123 | 109 | ||
298 | 124 | DLLEXPORT void _Ecs_Expose_Object( char* pyObject, std::string pyClassName, std::string pyObjectName ); | 110 | void _Ecs_Expose_Object( char* pyObject, std::string pyClassName, std::string pyObjectName ); |
299 | 125 | 111 | ||
300 | 126 | template< class ObjectType > | 112 | template< class ObjectType > |
302 | 127 | DLLEXPORT void Ecs_Expose_Object( ObjectType* object, std::string pyObjectName ) | 113 | void Ecs_Expose_Object( ObjectType* object, std::string pyObjectName ) |
303 | 128 | { | 114 | { |
304 | 129 | for( unsigned long i = 0; i < EcsPythonClassesDict.size(); i++ ) | 115 | for( unsigned long i = 0; i < EcsPythonClassesDict.size(); i++ ) |
305 | 130 | { | 116 | { |
306 | 131 | 117 | ||
307 | === modified file 'include/dspatch/DspThread.h' | |||
308 | --- include/dspatch/DspThread.h 2014-01-25 10:46:21 +0000 | |||
309 | +++ include/dspatch/DspThread.h 2014-12-05 19:42:33 +0000 | |||
310 | @@ -1,6 +1,6 @@ | |||
311 | 1 | /************************************************************************ | 1 | /************************************************************************ |
312 | 2 | DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library | 2 | DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library |
314 | 3 | Copyright (c) 2012-2013 Marcus Tomlinson | 3 | Copyright (c) 2012-2014 Marcus Tomlinson |
315 | 4 | 4 | ||
316 | 5 | This file is part of DSPatch. | 5 | This file is part of DSPatch. |
317 | 6 | 6 | ||
318 | 7 | 7 | ||
319 | === modified file 'include/dspatch/DspThreadNull.h' | |||
320 | --- include/dspatch/DspThreadNull.h 2014-01-25 10:46:21 +0000 | |||
321 | +++ include/dspatch/DspThreadNull.h 2014-12-05 19:42:33 +0000 | |||
322 | @@ -1,6 +1,6 @@ | |||
323 | 1 | /************************************************************************ | 1 | /************************************************************************ |
324 | 2 | DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library | 2 | DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library |
326 | 3 | Copyright (c) 2012-2013 Marcus Tomlinson | 3 | Copyright (c) 2012-2014 Marcus Tomlinson |
327 | 4 | 4 | ||
328 | 5 | This file is part of DSPatch. | 5 | This file is part of DSPatch. |
329 | 6 | 6 | ||
330 | @@ -55,7 +55,7 @@ | |||
331 | 55 | HighPriority, | 55 | HighPriority, |
332 | 56 | HighestPriority, | 56 | HighestPriority, |
333 | 57 | 57 | ||
335 | 58 | TimeCriticalPriority, | 58 | TimeCriticalPriority |
336 | 59 | }; | 59 | }; |
337 | 60 | 60 | ||
338 | 61 | virtual void Start( Priority priority ) {} | 61 | virtual void Start( Priority priority ) {} |
339 | 62 | 62 | ||
340 | === modified file 'include/dspatch/DspThreadUnix.h' | |||
341 | --- include/dspatch/DspThreadUnix.h 2014-01-25 10:46:21 +0000 | |||
342 | +++ include/dspatch/DspThreadUnix.h 2014-12-05 19:42:33 +0000 | |||
343 | @@ -1,6 +1,6 @@ | |||
344 | 1 | /************************************************************************ | 1 | /************************************************************************ |
345 | 2 | DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library | 2 | DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library |
347 | 3 | Copyright (c) 2012-2013 Marcus Tomlinson | 3 | Copyright (c) 2012-2014 Marcus Tomlinson |
348 | 4 | 4 | ||
349 | 5 | This file is part of DSPatch. | 5 | This file is part of DSPatch. |
350 | 6 | 6 | ||
351 | @@ -35,7 +35,8 @@ | |||
352 | 35 | class DspThread | 35 | class DspThread |
353 | 36 | { | 36 | { |
354 | 37 | public: | 37 | public: |
356 | 38 | DspThread() {} | 38 | DspThread() |
357 | 39 | : _threadAttatched( false ) {} | ||
358 | 39 | 40 | ||
359 | 40 | virtual ~DspThread() | 41 | virtual ~DspThread() |
360 | 41 | { | 42 | { |
361 | @@ -52,19 +53,24 @@ | |||
362 | 52 | HighPriority, | 53 | HighPriority, |
363 | 53 | HighestPriority, | 54 | HighestPriority, |
364 | 54 | 55 | ||
366 | 55 | TimeCriticalPriority, | 56 | TimeCriticalPriority |
367 | 56 | }; | 57 | }; |
368 | 57 | 58 | ||
369 | 58 | virtual void Start( Priority priority = NormalPriority ) | 59 | virtual void Start( Priority priority = NormalPriority ) |
370 | 59 | { | 60 | { |
371 | 60 | pthread_create( &_thread, NULL, _ThreadFunc, this ); | 61 | pthread_create( &_thread, NULL, _ThreadFunc, this ); |
372 | 62 | _threadAttatched = true; | ||
373 | 61 | 63 | ||
374 | 62 | _SetPriority( _thread, priority ); | 64 | _SetPriority( _thread, priority ); |
375 | 63 | } | 65 | } |
376 | 64 | 66 | ||
377 | 65 | virtual void Stop() | 67 | virtual void Stop() |
378 | 66 | { | 68 | { |
380 | 67 | pthread_detach( _thread ); | 69 | if( _threadAttatched ) |
381 | 70 | { | ||
382 | 71 | pthread_detach( _thread ); | ||
383 | 72 | _threadAttatched = false; | ||
384 | 73 | } | ||
385 | 68 | } | 74 | } |
386 | 69 | 75 | ||
387 | 70 | static void SetPriority( Priority priority ) | 76 | static void SetPriority( Priority priority ) |
388 | @@ -78,8 +84,6 @@ | |||
389 | 78 | } | 84 | } |
390 | 79 | 85 | ||
391 | 80 | private: | 86 | private: |
392 | 81 | pthread_t _thread; | ||
393 | 82 | |||
394 | 83 | static void* _ThreadFunc( void* pv ) | 87 | static void* _ThreadFunc( void* pv ) |
395 | 84 | { | 88 | { |
396 | 85 | ( reinterpret_cast<DspThread*>( pv ) )->_Run(); | 89 | ( reinterpret_cast<DspThread*>( pv ) )->_Run(); |
397 | @@ -100,14 +104,16 @@ | |||
398 | 100 | 104 | ||
399 | 101 | pthread_setschedparam( threadID, policy, ¶m ); | 105 | pthread_setschedparam( threadID, policy, ¶m ); |
400 | 102 | } | 106 | } |
401 | 107 | |||
402 | 108 | private: | ||
403 | 109 | pthread_t _thread; | ||
404 | 110 | bool _threadAttatched; | ||
405 | 103 | }; | 111 | }; |
406 | 104 | 112 | ||
407 | 105 | //================================================================================================= | 113 | //================================================================================================= |
408 | 106 | 114 | ||
409 | 107 | class DspMutex | 115 | class DspMutex |
410 | 108 | { | 116 | { |
411 | 109 | friend class DspWaitCondition; | ||
412 | 110 | |||
413 | 111 | public: | 117 | public: |
414 | 112 | DspMutex() | 118 | DspMutex() |
415 | 113 | { | 119 | { |
416 | @@ -130,6 +136,8 @@ | |||
417 | 130 | } | 136 | } |
418 | 131 | 137 | ||
419 | 132 | private: | 138 | private: |
420 | 139 | friend class DspWaitCondition; | ||
421 | 140 | |||
422 | 133 | pthread_mutex_t _mutex; | 141 | pthread_mutex_t _mutex; |
423 | 134 | }; | 142 | }; |
424 | 135 | 143 | ||
425 | 136 | 144 | ||
426 | === modified file 'include/dspatch/DspThreadWin.h' | |||
427 | --- include/dspatch/DspThreadWin.h 2014-01-25 10:46:21 +0000 | |||
428 | +++ include/dspatch/DspThreadWin.h 2014-12-05 19:42:33 +0000 | |||
429 | @@ -1,6 +1,6 @@ | |||
430 | 1 | /************************************************************************ | 1 | /************************************************************************ |
431 | 2 | DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library | 2 | DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library |
433 | 3 | Copyright (c) 2012-2013 Marcus Tomlinson | 3 | Copyright (c) 2012-2014 Marcus Tomlinson |
434 | 4 | 4 | ||
435 | 5 | This file is part of DSPatch. | 5 | This file is part of DSPatch. |
436 | 6 | 6 | ||
437 | @@ -35,10 +35,10 @@ | |||
438 | 35 | { | 35 | { |
439 | 36 | public: | 36 | public: |
440 | 37 | DspThread() | 37 | DspThread() |
442 | 38 | : _threadHandle( NULL ) {} | 38 | : _threadHandle( NULL ) {} |
443 | 39 | 39 | ||
446 | 40 | DspThread( const DspThread& ) | 40 | DspThread( DspThread const& ) |
447 | 41 | : _threadHandle( NULL ) {} | 41 | : _threadHandle( NULL ) {} |
448 | 42 | 42 | ||
449 | 43 | virtual ~DspThread() | 43 | virtual ~DspThread() |
450 | 44 | { | 44 | { |
451 | @@ -55,7 +55,7 @@ | |||
452 | 55 | HighPriority = 1, | 55 | HighPriority = 1, |
453 | 56 | HighestPriority = 2, | 56 | HighestPriority = 2, |
454 | 57 | 57 | ||
456 | 58 | TimeCriticalPriority = 15, | 58 | TimeCriticalPriority = 15 |
457 | 59 | }; | 59 | }; |
458 | 60 | 60 | ||
459 | 61 | virtual void Start( Priority priority = NormalPriority ) | 61 | virtual void Start( Priority priority = NormalPriority ) |
460 | @@ -91,6 +91,7 @@ | |||
461 | 91 | 91 | ||
462 | 92 | virtual void _Run() = 0; | 92 | virtual void _Run() = 0; |
463 | 93 | 93 | ||
464 | 94 | private: | ||
465 | 94 | HANDLE _threadHandle; | 95 | HANDLE _threadHandle; |
466 | 95 | }; | 96 | }; |
467 | 96 | 97 | ||
468 | @@ -104,7 +105,7 @@ | |||
469 | 104 | InitializeCriticalSection( &_cs ); | 105 | InitializeCriticalSection( &_cs ); |
470 | 105 | } | 106 | } |
471 | 106 | 107 | ||
473 | 107 | DspMutex( const DspMutex& ) | 108 | DspMutex( DspMutex const& ) |
474 | 108 | { | 109 | { |
475 | 109 | InitializeCriticalSection( &_cs ); | 110 | InitializeCriticalSection( &_cs ); |
476 | 110 | } | 111 | } |
477 | @@ -138,7 +139,7 @@ | |||
478 | 138 | _hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); | 139 | _hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); |
479 | 139 | } | 140 | } |
480 | 140 | 141 | ||
482 | 141 | DspWaitCondition( const DspWaitCondition& ) | 142 | DspWaitCondition( DspWaitCondition const& ) |
483 | 142 | { | 143 | { |
484 | 143 | _hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); | 144 | _hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); |
485 | 144 | } | 145 | } |
486 | 145 | 146 | ||
487 | === modified file 'include/ecspython/EcsMacros.h' | |||
488 | --- include/ecspython/EcsMacros.h 2014-01-26 12:29:03 +0000 | |||
489 | +++ include/ecspython/EcsMacros.h 2014-12-05 19:42:33 +0000 | |||
490 | @@ -1,6 +1,6 @@ | |||
491 | 1 | /************************************************************************ | 1 | /************************************************************************ |
492 | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ |
494 | 3 | Copyright (c) 2012-2013 Marcus Tomlinson | 3 | Copyright (c) 2012-2014 Marcus Tomlinson |
495 | 4 | 4 | ||
496 | 5 | This file is part of EcsPython. | 5 | This file is part of EcsPython. |
497 | 6 | 6 | ||
498 | @@ -36,27 +36,25 @@ | |||
499 | 36 | #include <typeinfo> | 36 | #include <typeinfo> |
500 | 37 | #include <string> | 37 | #include <string> |
501 | 38 | 38 | ||
502 | 39 | #include <dspatch/DspThread.h> | ||
503 | 40 | |||
504 | 41 | //================================================================================================= | 39 | //================================================================================================= |
505 | 42 | 40 | ||
506 | 43 | typedef struct _object PyObject; | 41 | typedef struct _object PyObject; |
507 | 44 | typedef PyObject* (*PyCFunction)( PyObject *, PyObject * ); | 42 | typedef PyObject* (*PyCFunction)( PyObject *, PyObject * ); |
508 | 45 | 43 | ||
510 | 46 | DLLPORT extern int (*_Ecs_ParseTuple)( PyObject *, const char *, ... ); | 44 | extern int (*_Ecs_ParseTuple)( PyObject *, const char *, ... ); |
511 | 47 | 45 | ||
512 | 48 | //================================================================================================= | 46 | //================================================================================================= |
513 | 49 | 47 | ||
515 | 50 | DLLEXPORT void _EcsAddNewMethod( const char *methodName, PyCFunction methodPointer, int methodFlags ); | 48 | void _EcsAddNewMethod( const char *methodName, PyCFunction methodPointer, int methodFlags ); |
516 | 51 | 49 | ||
517 | 52 | //------------------------------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------------------------------- |
518 | 53 | 51 | ||
519 | 54 | template< class Type > | 52 | template< class Type > |
521 | 55 | DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const Type& Value ); | 53 | PyObject* _Ecs_ToPyObject( const Type& Value ); |
522 | 56 | 54 | ||
523 | 57 | //------------------------------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------------------------------- |
524 | 58 | 56 | ||
526 | 59 | DLLEXPORT PyObject* _Ecs_GetPythonNull(); | 57 | PyObject* _Ecs_GetPythonNull(); |
527 | 60 | 58 | ||
528 | 61 | //================================================================================================= | 59 | //================================================================================================= |
529 | 62 | // COMMON TOOLS | 60 | // COMMON TOOLS |
530 | @@ -94,15 +92,35 @@ | |||
531 | 94 | else if( typeid( Type ) == typeid( bool ) ) | 92 | else if( typeid( Type ) == typeid( bool ) ) |
532 | 95 | append = "i"; | 93 | append = "i"; |
533 | 96 | else if( typeid( Type ) == typeid( double ) ) | 94 | else if( typeid( Type ) == typeid( double ) ) |
535 | 97 | append = "d"; | 95 | append = "f"; |
536 | 98 | else if( typeid( Type ) == typeid( float ) ) | 96 | else if( typeid( Type ) == typeid( float ) ) |
537 | 99 | append = "f"; | 97 | append = "f"; |
538 | 98 | else if( typeid( Type ) == typeid( void* ) ) | ||
539 | 99 | append = "k"; | ||
540 | 100 | 100 | ||
541 | 101 | pyTypes.append( append ); | 101 | pyTypes.append( append ); |
542 | 102 | } | 102 | } |
543 | 103 | 103 | ||
544 | 104 | //------------------------------------------------------------------------------------------------- | 104 | //------------------------------------------------------------------------------------------------- |
545 | 105 | 105 | ||
546 | 106 | template< class Type > | ||
547 | 107 | void _Ecs_FromPyObject( char* in, Type& out ) | ||
548 | 108 | { | ||
549 | 109 | out = (Type)in; | ||
550 | 110 | } | ||
551 | 111 | |||
552 | 112 | inline void _Ecs_FromPyObject( char* in, double& out ) | ||
553 | 113 | { | ||
554 | 114 | out = *(float*)∈ | ||
555 | 115 | } | ||
556 | 116 | |||
557 | 117 | inline void _Ecs_FromPyObject( char* in, float& out ) | ||
558 | 118 | { | ||
559 | 119 | out = *(float*)∈ | ||
560 | 120 | } | ||
561 | 121 | |||
562 | 122 | //------------------------------------------------------------------------------------------------- | ||
563 | 123 | |||
564 | 106 | template< class RetT > | 124 | template< class RetT > |
565 | 107 | static std::string _Ecs_MakeMethodArgs() | 125 | static std::string _Ecs_MakeMethodArgs() |
566 | 108 | { | 126 | { |
567 | @@ -167,11 +185,11 @@ | |||
568 | 167 | static void Ecs_Init##_##Class()\ | 185 | static void Ecs_Init##_##Class()\ |
569 | 168 | {\ | 186 | {\ |
570 | 169 | EcsPythonClassesDict.push_back( new EcsClass( #Class, typeid( Class ) ) );\ | 187 | EcsPythonClassesDict.push_back( new EcsClass( #Class, typeid( Class ) ) );\ |
576 | 170 | EcsPythonClassesDef.append("class " #Class ": \n\ | 188 | EcsPythonClassesDef.append("class " #Class ":\n\ |
577 | 171 | \t def SetEcsPtr( self, i ): \n\ | 189 | \tdef __init__( self, ecsPtr ):\n\ |
578 | 172 | \t\t self._self = i \n\ | 190 | \t\tself._self = ecsPtr\n\ |
579 | 173 | \t def GetEcsPtr( self ): \n\ | 191 | \tdef __call__( self ):\n\ |
580 | 174 | \t\t return self._self \n");\ | 192 | \t\treturn self._self\n");\ |
581 | 175 | } | 193 | } |
582 | 176 | 194 | ||
583 | 177 | //================================================================================================= | 195 | //================================================================================================= |
584 | @@ -183,8 +201,8 @@ | |||
585 | 183 | {\ | 201 | {\ |
586 | 184 | std::string methodArgs = _Ecs_MakeMethodArgs< __VA_ARGS__ >();\ | 202 | std::string methodArgs = _Ecs_MakeMethodArgs< __VA_ARGS__ >();\ |
587 | 185 | _EcsAddNewMethod( #Class "_" #Method, Class##_##Method, 0x0001 );\ | 203 | _EcsAddNewMethod( #Class "_" #Method, Class##_##Method, 0x0001 );\ |
590 | 186 | EcsPythonClassesDef.append( "\t def " #Method "( self").append(methodArgs).append(" ): \n\ | 204 | EcsPythonClassesDef.append( "\tdef " #Method "( self").append(methodArgs).append(" ):\n\ |
591 | 187 | \t\t return EcsPython." #Class "_" #Method "( self._self").append(methodArgs).append(" ) \n" );\ | 205 | \t\treturn EcsPython." #Class "_" #Method "( self._self").append(methodArgs).append(" )\n" );\ |
592 | 188 | } | 206 | } |
593 | 189 | 207 | ||
594 | 190 | //------------------------------------------------------------------------------------------------- | 208 | //------------------------------------------------------------------------------------------------- |
595 | @@ -204,7 +222,10 @@ | |||
596 | 204 | success = true; char* objs[2]; std::string pyTypes = "k";\ | 222 | success = true; char* objs[2]; std::string pyTypes = "k";\ |
597 | 205 | _Ecs_AppendPythonArgType<A1T>( pyTypes );\ | 223 | _Ecs_AppendPythonArgType<A1T>( pyTypes );\ |
598 | 206 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1] ) )\ | 224 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1] ) )\ |
600 | 207 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1] );\ | 225 | {\ |
601 | 226 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
602 | 227 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1 );\ | ||
603 | 228 | }\ | ||
604 | 208 | success = false; return RetT();\ | 229 | success = false; return RetT();\ |
605 | 209 | }\ | 230 | }\ |
606 | 210 | template< class ObjT, class RetT, class A1T, class A2T >\ | 231 | template< class ObjT, class RetT, class A1T, class A2T >\ |
607 | @@ -214,7 +235,11 @@ | |||
608 | 214 | _Ecs_AppendPythonArgType<A1T>( pyTypes );\ | 235 | _Ecs_AppendPythonArgType<A1T>( pyTypes );\ |
609 | 215 | _Ecs_AppendPythonArgType<A2T>( pyTypes );\ | 236 | _Ecs_AppendPythonArgType<A2T>( pyTypes );\ |
610 | 216 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2] ) )\ | 237 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2] ) )\ |
612 | 217 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2] );\ | 238 | {\ |
613 | 239 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
614 | 240 | A2T a2; _Ecs_FromPyObject(objs[2], a2);\ | ||
615 | 241 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2 );\ | ||
616 | 242 | }\ | ||
617 | 218 | success = false; return RetT();\ | 243 | success = false; return RetT();\ |
618 | 219 | }\ | 244 | }\ |
619 | 220 | template< class ObjT, class RetT, class A1T, class A2T, class A3T >\ | 245 | template< class ObjT, class RetT, class A1T, class A2T, class A3T >\ |
620 | @@ -225,7 +250,12 @@ | |||
621 | 225 | _Ecs_AppendPythonArgType<A2T>( pyTypes );\ | 250 | _Ecs_AppendPythonArgType<A2T>( pyTypes );\ |
622 | 226 | _Ecs_AppendPythonArgType<A3T>( pyTypes );\ | 251 | _Ecs_AppendPythonArgType<A3T>( pyTypes );\ |
623 | 227 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3] ) )\ | 252 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3] ) )\ |
625 | 228 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3] );\ | 253 | {\ |
626 | 254 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
627 | 255 | A2T a2; _Ecs_FromPyObject(objs[2], a2);\ | ||
628 | 256 | A3T a3; _Ecs_FromPyObject(objs[3], a3);\ | ||
629 | 257 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3 );\ | ||
630 | 258 | }\ | ||
631 | 229 | success = false; return RetT();\ | 259 | success = false; return RetT();\ |
632 | 230 | }\ | 260 | }\ |
633 | 231 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T >\ | 261 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T >\ |
634 | @@ -237,7 +267,13 @@ | |||
635 | 237 | _Ecs_AppendPythonArgType<A3T>( pyTypes );\ | 267 | _Ecs_AppendPythonArgType<A3T>( pyTypes );\ |
636 | 238 | _Ecs_AppendPythonArgType<A4T>( pyTypes );\ | 268 | _Ecs_AppendPythonArgType<A4T>( pyTypes );\ |
637 | 239 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4] ) )\ | 269 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4] ) )\ |
639 | 240 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3], (A4T)objs[4] );\ | 270 | {\ |
640 | 271 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
641 | 272 | A2T a2; _Ecs_FromPyObject(objs[2], a2);\ | ||
642 | 273 | A3T a3; _Ecs_FromPyObject(objs[3], a3);\ | ||
643 | 274 | A4T a4; _Ecs_FromPyObject(objs[4], a4);\ | ||
644 | 275 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4 );\ | ||
645 | 276 | }\ | ||
646 | 241 | success = false; return RetT();\ | 277 | success = false; return RetT();\ |
647 | 242 | }\ | 278 | }\ |
648 | 243 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T >\ | 279 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T >\ |
649 | @@ -250,7 +286,14 @@ | |||
650 | 250 | _Ecs_AppendPythonArgType<A4T>( pyTypes );\ | 286 | _Ecs_AppendPythonArgType<A4T>( pyTypes );\ |
651 | 251 | _Ecs_AppendPythonArgType<A5T>( pyTypes );\ | 287 | _Ecs_AppendPythonArgType<A5T>( pyTypes );\ |
652 | 252 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5] ) )\ | 288 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5] ) )\ |
654 | 253 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3], (A4T)objs[4], (A5T)objs[5] );\ | 289 | {\ |
655 | 290 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
656 | 291 | A2T a2; _Ecs_FromPyObject(objs[2], a2);\ | ||
657 | 292 | A3T a3; _Ecs_FromPyObject(objs[3], a3);\ | ||
658 | 293 | A4T a4; _Ecs_FromPyObject(objs[4], a4);\ | ||
659 | 294 | A5T a5; _Ecs_FromPyObject(objs[5], a5);\ | ||
660 | 295 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5 );\ | ||
661 | 296 | }\ | ||
662 | 254 | success = false; return RetT();\ | 297 | success = false; return RetT();\ |
663 | 255 | }\ | 298 | }\ |
664 | 256 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T >\ | 299 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T >\ |
665 | @@ -264,7 +307,15 @@ | |||
666 | 264 | _Ecs_AppendPythonArgType<A5T>( pyTypes );\ | 307 | _Ecs_AppendPythonArgType<A5T>( pyTypes );\ |
667 | 265 | _Ecs_AppendPythonArgType<A6T>( pyTypes );\ | 308 | _Ecs_AppendPythonArgType<A6T>( pyTypes );\ |
668 | 266 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6] ) )\ | 309 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6] ) )\ |
670 | 267 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3], (A4T)objs[4], (A5T)objs[5], (A6T)objs[6] );\ | 310 | {\ |
671 | 311 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
672 | 312 | A2T a2; _Ecs_FromPyObject(objs[2], a2);\ | ||
673 | 313 | A3T a3; _Ecs_FromPyObject(objs[3], a3);\ | ||
674 | 314 | A4T a4; _Ecs_FromPyObject(objs[4], a4);\ | ||
675 | 315 | A5T a5; _Ecs_FromPyObject(objs[5], a5);\ | ||
676 | 316 | A6T a6; _Ecs_FromPyObject(objs[6], a6);\ | ||
677 | 317 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6 );\ | ||
678 | 318 | }\ | ||
679 | 268 | success = false; return RetT();\ | 319 | success = false; return RetT();\ |
680 | 269 | }\ | 320 | }\ |
681 | 270 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T >\ | 321 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T >\ |
682 | @@ -279,7 +330,16 @@ | |||
683 | 279 | _Ecs_AppendPythonArgType<A6T>( pyTypes );\ | 330 | _Ecs_AppendPythonArgType<A6T>( pyTypes );\ |
684 | 280 | _Ecs_AppendPythonArgType<A7T>( pyTypes );\ | 331 | _Ecs_AppendPythonArgType<A7T>( pyTypes );\ |
685 | 281 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6], &objs[7] ) )\ | 332 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6], &objs[7] ) )\ |
687 | 282 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3], (A4T)objs[4], (A5T)objs[5], (A6T)objs[6], (A7T)objs[7] );\ | 333 | {\ |
688 | 334 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
689 | 335 | A2T a2; _Ecs_FromPyObject(objs[2], a2);\ | ||
690 | 336 | A3T a3; _Ecs_FromPyObject(objs[3], a3);\ | ||
691 | 337 | A4T a4; _Ecs_FromPyObject(objs[4], a4);\ | ||
692 | 338 | A5T a5; _Ecs_FromPyObject(objs[5], a5);\ | ||
693 | 339 | A6T a6; _Ecs_FromPyObject(objs[6], a6);\ | ||
694 | 340 | A7T a7; _Ecs_FromPyObject(objs[7], a7);\ | ||
695 | 341 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6, a7 );\ | ||
696 | 342 | }\ | ||
697 | 283 | success = false; return RetT();\ | 343 | success = false; return RetT();\ |
698 | 284 | }\ | 344 | }\ |
699 | 285 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T >\ | 345 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T >\ |
700 | @@ -295,7 +355,17 @@ | |||
701 | 295 | _Ecs_AppendPythonArgType<A7T>( pyTypes );\ | 355 | _Ecs_AppendPythonArgType<A7T>( pyTypes );\ |
702 | 296 | _Ecs_AppendPythonArgType<A8T>( pyTypes );\ | 356 | _Ecs_AppendPythonArgType<A8T>( pyTypes );\ |
703 | 297 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6], &objs[7], &objs[8] ) )\ | 357 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6], &objs[7], &objs[8] ) )\ |
705 | 298 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3], (A4T)objs[4], (A5T)objs[5], (A6T)objs[6], (A7T)objs[7], (A8T)objs[8] );\ | 358 | {\ |
706 | 359 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
707 | 360 | A2T a2; _Ecs_FromPyObject(objs[2], a2);\ | ||
708 | 361 | A3T a3; _Ecs_FromPyObject(objs[3], a3);\ | ||
709 | 362 | A4T a4; _Ecs_FromPyObject(objs[4], a4);\ | ||
710 | 363 | A5T a5; _Ecs_FromPyObject(objs[5], a5);\ | ||
711 | 364 | A6T a6; _Ecs_FromPyObject(objs[6], a6);\ | ||
712 | 365 | A7T a7; _Ecs_FromPyObject(objs[7], a7);\ | ||
713 | 366 | A8T a8; _Ecs_FromPyObject(objs[8], a8);\ | ||
714 | 367 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6, a7, a8 );\ | ||
715 | 368 | }\ | ||
716 | 299 | success = false; return RetT();\ | 369 | success = false; return RetT();\ |
717 | 300 | }\ | 370 | }\ |
718 | 301 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T, class A9T >\ | 371 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T, class A9T >\ |
719 | @@ -312,7 +382,18 @@ | |||
720 | 312 | _Ecs_AppendPythonArgType<A8T>( pyTypes );\ | 382 | _Ecs_AppendPythonArgType<A8T>( pyTypes );\ |
721 | 313 | _Ecs_AppendPythonArgType<A9T>( pyTypes );\ | 383 | _Ecs_AppendPythonArgType<A9T>( pyTypes );\ |
722 | 314 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6], &objs[7], &objs[8], &objs[9] ) )\ | 384 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6], &objs[7], &objs[8], &objs[9] ) )\ |
724 | 315 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3], (A4T)objs[4], (A5T)objs[5], (A6T)objs[6], (A7T)objs[7], (A8T)objs[8], (A9T)objs[9] );\ | 385 | {\ |
725 | 386 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
726 | 387 | A2T a2; _Ecs_FromPyObject(objs[2], a2);\ | ||
727 | 388 | A3T a3; _Ecs_FromPyObject(objs[3], a3);\ | ||
728 | 389 | A4T a4; _Ecs_FromPyObject(objs[4], a4);\ | ||
729 | 390 | A5T a5; _Ecs_FromPyObject(objs[5], a5);\ | ||
730 | 391 | A6T a6; _Ecs_FromPyObject(objs[6], a6);\ | ||
731 | 392 | A7T a7; _Ecs_FromPyObject(objs[7], a7);\ | ||
732 | 393 | A8T a8; _Ecs_FromPyObject(objs[8], a8);\ | ||
733 | 394 | A9T a9; _Ecs_FromPyObject(objs[9], a9);\ | ||
734 | 395 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6, a7, a8, a9 );\ | ||
735 | 396 | }\ | ||
736 | 316 | success = false; return RetT();\ | 397 | success = false; return RetT();\ |
737 | 317 | }\ | 398 | }\ |
738 | 318 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T, class A9T, class A10T >\ | 399 | template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T, class A9T, class A10T >\ |
739 | @@ -330,7 +411,19 @@ | |||
740 | 330 | _Ecs_AppendPythonArgType<A9T>( pyTypes );\ | 411 | _Ecs_AppendPythonArgType<A9T>( pyTypes );\ |
741 | 331 | _Ecs_AppendPythonArgType<A10T>( pyTypes );\ | 412 | _Ecs_AppendPythonArgType<A10T>( pyTypes );\ |
742 | 332 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6], &objs[7], &objs[8], &objs[9], &objs[10] ) )\ | 413 | if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1], &objs[2], &objs[3], &objs[4], &objs[5], &objs[6], &objs[7], &objs[8], &objs[9], &objs[10] ) )\ |
744 | 333 | return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3], (A4T)objs[4], (A5T)objs[5], (A6T)objs[6], (A7T)objs[7], (A8T)objs[8], (A9T)objs[9], (A10T)objs[10] );\ | 414 | {\ |
745 | 415 | A1T a1; _Ecs_FromPyObject(objs[1], a1);\ | ||
746 | 416 | A2T a2; _Ecs_FromPyObject(objs[2], a2);\ | ||
747 | 417 | A3T a3; _Ecs_FromPyObject(objs[3], a3);\ | ||
748 | 418 | A4T a4; _Ecs_FromPyObject(objs[4], a4);\ | ||
749 | 419 | A5T a5; _Ecs_FromPyObject(objs[5], a5);\ | ||
750 | 420 | A6T a6; _Ecs_FromPyObject(objs[6], a6);\ | ||
751 | 421 | A7T a7; _Ecs_FromPyObject(objs[7], a7);\ | ||
752 | 422 | A8T a8; _Ecs_FromPyObject(objs[8], a8);\ | ||
753 | 423 | A9T a9; _Ecs_FromPyObject(objs[9], a9);\ | ||
754 | 424 | A10T a10; _Ecs_FromPyObject(objs[10], a10);\ | ||
755 | 425 | return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 );\ | ||
756 | 426 | }\ | ||
757 | 334 | success = false; return RetT();\ | 427 | success = false; return RetT();\ |
758 | 335 | } | 428 | } |
759 | 336 | 429 | ||
760 | @@ -338,10 +431,10 @@ | |||
761 | 338 | 431 | ||
762 | 339 | #define ECS_REGISTER_METHOD_RETURN( Class, Method, ReturnType, ... )\ | 432 | #define ECS_REGISTER_METHOD_RETURN( Class, Method, ReturnType, ... )\ |
763 | 340 | _MAKE_METHOD_CALL( Class, Method )\ | 433 | _MAKE_METHOD_CALL( Class, Method )\ |
765 | 341 | static PyObject* Class##_##Method( PyObject* self, PyObject* args )\ | 434 | static PyObject* Class##_##Method( PyObject*, PyObject* args )\ |
766 | 342 | {\ | 435 | {\ |
767 | 343 | bool success;\ | 436 | bool success;\ |
769 | 344 | PyObject* result = _Ecs_GetPythonReturnValue( Class##_##Call##Method< Class, ReturnType, ##__VA_ARGS__ >( args, success ) );\ | 437 | PyObject* result = _Ecs_ToPyObject( Class##_##Call##Method< Class, ReturnType, ##__VA_ARGS__ >( args, success ) );\ |
770 | 345 | if( success )\ | 438 | if( success )\ |
771 | 346 | return result;\ | 439 | return result;\ |
772 | 347 | else\ | 440 | else\ |
773 | @@ -353,7 +446,7 @@ | |||
774 | 353 | 446 | ||
775 | 354 | #define ECS_REGISTER_METHOD_VOID( Class, Method, ... )\ | 447 | #define ECS_REGISTER_METHOD_VOID( Class, Method, ... )\ |
776 | 355 | _MAKE_METHOD_CALL( Class, Method )\ | 448 | _MAKE_METHOD_CALL( Class, Method )\ |
778 | 356 | static PyObject* Class##_##Method( PyObject* self, PyObject* args )\ | 449 | static PyObject* Class##_##Method( PyObject*, PyObject* args )\ |
779 | 357 | {\ | 450 | {\ |
780 | 358 | bool success;\ | 451 | bool success;\ |
781 | 359 | Class##_##Call##Method< Class, void, ##__VA_ARGS__ >( args, success );\ | 452 | Class##_##Call##Method< Class, void, ##__VA_ARGS__ >( args, success );\ |
782 | 360 | 453 | ||
783 | === added file 'readme_windows.txt' | |||
784 | --- readme_windows.txt 1970-01-01 00:00:00 +0000 | |||
785 | +++ readme_windows.txt 2014-12-05 19:42:33 +0000 | |||
786 | @@ -0,0 +1,15 @@ | |||
787 | 1 | Compiling ECS::Python on Windows: | ||
788 | 2 | |||
789 | 3 | Firstly, you'll need to ensure that the correct version of Python is | ||
790 | 4 | being referenced in the CMakeLists: | ||
791 | 5 | |||
792 | 6 | 1. Open CMakeLists.txt | ||
793 | 7 | 2. Update the paths under "if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")" | ||
794 | 8 | |||
795 | 9 | Secondly, the Python distro does not come packaged with the debug library: | ||
796 | 10 | "pythonXX_d.lib". So, in order to get ECS:Python to compile in Debug mode: | ||
797 | 11 | |||
798 | 12 | 1. Open: "PythonXX\include\pyconfig.h" | ||
799 | 13 | 2. Comment out the line "# define Py_DEBUG | ||
800 | 14 | " | ||
801 | 15 | 3. Search and replace "_d.lib" with ".lib" | ||
802 | 0 | \ No newline at end of file | 16 | \ No newline at end of file |
803 | 1 | 17 | ||
804 | === modified file 'src/EcsMacros.cpp' | |||
805 | --- src/EcsMacros.cpp 2014-01-25 10:46:21 +0000 | |||
806 | +++ src/EcsMacros.cpp 2014-12-05 19:42:33 +0000 | |||
807 | @@ -1,6 +1,6 @@ | |||
808 | 1 | /************************************************************************ | 1 | /************************************************************************ |
809 | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ |
811 | 3 | Copyright (c) 2012-2013 Marcus Tomlinson | 3 | Copyright (c) 2012-2014 Marcus Tomlinson |
812 | 4 | 4 | ||
813 | 5 | This file is part of EcsPython. | 5 | This file is part of EcsPython. |
814 | 6 | 6 | ||
815 | @@ -37,45 +37,49 @@ | |||
816 | 37 | 37 | ||
817 | 38 | //================================================================================================= | 38 | //================================================================================================= |
818 | 39 | 39 | ||
836 | 40 | DLLPORT int (*_Ecs_ParseTuple)( PyObject *, const char *, ... ) = NULL; | 40 | int (*_Ecs_ParseTuple)( PyObject *, const char *, ... ) = NULL; |
837 | 41 | 41 | ||
838 | 42 | //template PyObject* _Ecs_GetPythonReturnValue( const char*& ); | 42 | typedef char* charptr; |
839 | 43 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const std::string& ); | 43 | typedef void* voidptr; |
840 | 44 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const char& ); | 44 | |
841 | 45 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned char& ); | 45 | template PyObject* _Ecs_ToPyObject( const charptr& ); |
842 | 46 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const short& ); | 46 | template PyObject* _Ecs_ToPyObject( const std::string& ); |
843 | 47 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned short& ); | 47 | template PyObject* _Ecs_ToPyObject( const char& ); |
844 | 48 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const int& ); | 48 | template PyObject* _Ecs_ToPyObject( const unsigned char& ); |
845 | 49 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned int& ); | 49 | template PyObject* _Ecs_ToPyObject( const short& ); |
846 | 50 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const long& ); | 50 | template PyObject* _Ecs_ToPyObject( const unsigned short& ); |
847 | 51 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned long& ); | 51 | template PyObject* _Ecs_ToPyObject( const int& ); |
848 | 52 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const long long& ); | 52 | template PyObject* _Ecs_ToPyObject( const unsigned int& ); |
849 | 53 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned long long& ); | 53 | template PyObject* _Ecs_ToPyObject( const long& ); |
850 | 54 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const bool& ); | 54 | template PyObject* _Ecs_ToPyObject( const unsigned long& ); |
851 | 55 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const double& ); | 55 | template PyObject* _Ecs_ToPyObject( const long long& ); |
852 | 56 | template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const float& ); | 56 | template PyObject* _Ecs_ToPyObject( const unsigned long long& ); |
853 | 57 | template PyObject* _Ecs_ToPyObject( const bool& ); | ||
854 | 58 | template PyObject* _Ecs_ToPyObject( const double& ); | ||
855 | 59 | template PyObject* _Ecs_ToPyObject( const float& ); | ||
856 | 60 | template PyObject* _Ecs_ToPyObject( const voidptr& ); | ||
857 | 57 | 61 | ||
858 | 58 | //================================================================================================= | 62 | //================================================================================================= |
859 | 59 | 63 | ||
860 | 60 | void _EcsAddNewMethod( const char *methodName, PyCFunction methodPointer, int methodFlags ) | 64 | void _EcsAddNewMethod( const char *methodName, PyCFunction methodPointer, int methodFlags ) |
861 | 61 | { | 65 | { |
866 | 62 | if( _Ecs_ParseTuple == NULL ) | 66 | if( _Ecs_ParseTuple == NULL ) |
867 | 63 | { | 67 | { |
868 | 64 | _Ecs_ParseTuple = PyArg_ParseTuple; | 68 | _Ecs_ParseTuple = PyArg_ParseTuple; |
869 | 65 | } | 69 | } |
870 | 66 | 70 | ||
873 | 67 | PyMethodDef newMethod = { methodName, methodPointer, methodFlags }; | 71 | PyMethodDef newMethod = { methodName, methodPointer, methodFlags, NULL }; |
874 | 68 | EcsPythonMethods.push_back( newMethod ); | 72 | EcsPythonMethods.push_back( newMethod ); |
875 | 69 | } | 73 | } |
876 | 70 | 74 | ||
877 | 71 | //------------------------------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------------------------------- |
878 | 72 | 76 | ||
879 | 73 | template< class Type > | 77 | template< class Type > |
881 | 74 | PyObject* _Ecs_GetPythonReturnValue( const Type& Value ) | 78 | PyObject* _Ecs_ToPyObject( const Type& Value ) |
882 | 75 | { | 79 | { |
883 | 76 | if( typeid( Type ) == typeid( char* ) ) | 80 | if( typeid( Type ) == typeid( char* ) ) |
884 | 77 | return PyUnicode_FromFormat( "%s", *((char**)(&Value)) ); | 81 | return PyUnicode_FromFormat( "%s", *((char**)(&Value)) ); |
886 | 78 | if( typeid( Type ) == typeid( std::string ) ) | 82 | else if( typeid( Type ) == typeid( std::string ) ) |
887 | 79 | return PyUnicode_FromFormat( "%s", (*((std::string*)(&Value))).c_str() ); | 83 | return PyUnicode_FromFormat( "%s", (*((std::string*)(&Value))).c_str() ); |
888 | 80 | else if( typeid( Type ) == typeid( char ) ) | 84 | else if( typeid( Type ) == typeid( char ) ) |
889 | 81 | return PyUnicode_FromFormat( "%c", *((char*)(&Value)) ); | 85 | return PyUnicode_FromFormat( "%c", *((char*)(&Value)) ); |
890 | @@ -103,6 +107,8 @@ | |||
891 | 103 | return PyFloat_FromDouble( *((double*)(&Value)) ); | 107 | return PyFloat_FromDouble( *((double*)(&Value)) ); |
892 | 104 | else if( typeid( Type ) == typeid( float ) ) | 108 | else if( typeid( Type ) == typeid( float ) ) |
893 | 105 | return PyFloat_FromDouble( *((float*)(&Value)) ); | 109 | return PyFloat_FromDouble( *((float*)(&Value)) ); |
894 | 110 | else if( typeid( Type ) == typeid( void* ) ) | ||
895 | 111 | return PyLong_FromUnsignedLong( *((unsigned long*)(&Value)) ); | ||
896 | 106 | else | 112 | else |
897 | 107 | return NULL; | 113 | return NULL; |
898 | 108 | } | 114 | } |
899 | 109 | 115 | ||
900 | === modified file 'src/EcsPython.cpp' | |||
901 | --- src/EcsPython.cpp 2014-01-26 12:29:03 +0000 | |||
902 | +++ src/EcsPython.cpp 2014-12-05 19:42:33 +0000 | |||
903 | @@ -1,6 +1,6 @@ | |||
904 | 1 | /************************************************************************ | 1 | /************************************************************************ |
905 | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ | 2 | ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++ |
907 | 3 | Copyright (c) 2012-2013 Marcus Tomlinson | 3 | Copyright (c) 2012-2014 Marcus Tomlinson |
908 | 4 | 4 | ||
909 | 5 | This file is part of EcsPython. | 5 | This file is part of EcsPython. |
910 | 6 | 6 | ||
911 | @@ -43,14 +43,14 @@ | |||
912 | 43 | // EcsPython Globals | 43 | // EcsPython Globals |
913 | 44 | // ================= | 44 | // ================= |
914 | 45 | 45 | ||
920 | 46 | DLLPORT DspMutex EcsPythonCmdMutex; // Mutex for thread-safe python calls | 46 | DspMutex EcsPythonCmdMutex; // Mutex for thread-safe python calls |
921 | 47 | DLLPORT std::vector< EcsClass* > EcsPythonClassesDict; // C++ class dictionary | 47 | std::vector< EcsClass* > EcsPythonClassesDict; // C++ class dictionary |
922 | 48 | DLLPORT std::string EcsPythonClassesDef; // Python definition string for C++ classes | 48 | std::string EcsPythonClassesDef; // Python definition string for C++ classes |
923 | 49 | DLLPORT std::vector< PyMethodDef > EcsPythonMethods; // Methods for EcsPython python module | 49 | std::vector< PyMethodDef > EcsPythonMethods; // Methods for EcsPython python module |
924 | 50 | DLLPORT std::vector< EcsObject* > EcsExposedObjects; // C++ objects exposed to Python | 50 | std::vector< EcsObject* > EcsExposedObjects; // C++ objects exposed to Python |
925 | 51 | 51 | ||
926 | 52 | #if PY_MAJOR_VERSION >= 3 | 52 | #if PY_MAJOR_VERSION >= 3 |
928 | 53 | DLLPORT struct PyModuleDef EcsPythonModule; // EcsPython python module | 53 | struct PyModuleDef EcsPythonModule; // EcsPython python module |
929 | 54 | #endif | 54 | #endif |
930 | 55 | 55 | ||
931 | 56 | //================================================================================================= | 56 | //================================================================================================= |
932 | @@ -75,7 +75,7 @@ | |||
933 | 75 | _Ecs_Expose_Object( EcsExposedObjects[i]->pyObject, EcsExposedObjects[i]->pyClassName, EcsExposedObjects[i]->pyObjectName ); | 75 | _Ecs_Expose_Object( EcsExposedObjects[i]->pyObject, EcsExposedObjects[i]->pyClassName, EcsExposedObjects[i]->pyObjectName ); |
934 | 76 | } | 76 | } |
935 | 77 | 77 | ||
937 | 78 | EcsPythonMethods.pop_back(); // pop the NULL off the end of the methods array so that more can be added later | 78 | EcsPythonMethods.pop_back(); // pop the NULL off the end of the methods array so that more can be added later |
938 | 79 | } | 79 | } |
939 | 80 | 80 | ||
940 | 81 | //------------------------------------------------------------------------------------------------- | 81 | //------------------------------------------------------------------------------------------------- |
941 | @@ -171,7 +171,7 @@ | |||
942 | 171 | { | 171 | { |
943 | 172 | PyMethodDef nullMethod = | 172 | PyMethodDef nullMethod = |
944 | 173 | { | 173 | { |
946 | 174 | NULL, NULL, 0 | 174 | NULL, NULL, 0, NULL |
947 | 175 | }; | 175 | }; |
948 | 176 | EcsPythonMethods.push_back( nullMethod ); | 176 | EcsPythonMethods.push_back( nullMethod ); |
949 | 177 | 177 | ||
950 | @@ -209,11 +209,7 @@ | |||
951 | 209 | module = PyImport_ImportModule( "__main__" ); | 209 | module = PyImport_ImportModule( "__main__" ); |
952 | 210 | PyObject_SetAttrString( module, "ecsPtr", newPyObject ); | 210 | PyObject_SetAttrString( module, "ecsPtr", newPyObject ); |
953 | 211 | 211 | ||
959 | 212 | pythonCall.append( pyObjectName ).append( " = " ).append( pyClassName ).append( "()" ); | 212 | pythonCall.append( pyObjectName ).append( " = " ).append( pyClassName ).append( "(ecsPtr)" ); |
955 | 213 | Ecs_Python_Cmd( pythonCall ); | ||
956 | 214 | |||
957 | 215 | pythonCall.clear(); | ||
958 | 216 | pythonCall.append( pyObjectName ).append( ".SetEcsPtr(ecsPtr)" ); | ||
960 | 217 | Ecs_Python_Cmd( pythonCall ); | 213 | Ecs_Python_Cmd( pythonCall ); |
961 | 218 | 214 | ||
962 | 219 | Ecs_Python_Cmd( "del ecsPtr" ); | 215 | Ecs_Python_Cmd( "del ecsPtr" ); |
963 | 220 | 216 | ||
964 | === removed directory 'win_fix' | |||
965 | === removed directory 'win_fix/Python27' | |||
966 | === removed file 'win_fix/Python27/pyconfig.h' | |||
967 | --- win_fix/Python27/pyconfig.h 2014-01-17 13:26:46 +0000 | |||
968 | +++ win_fix/Python27/pyconfig.h 1970-01-01 00:00:00 +0000 | |||
969 | @@ -1,756 +0,0 @@ | |||
970 | 1 | #ifndef Py_CONFIG_H | ||
971 | 2 | #define Py_CONFIG_H | ||
972 | 3 | |||
973 | 4 | /* pyconfig.h. NOT Generated automatically by configure. | ||
974 | 5 | |||
975 | 6 | This is a manually maintained version used for the Watcom, | ||
976 | 7 | Borland and Microsoft Visual C++ compilers. It is a | ||
977 | 8 | standard part of the Python distribution. | ||
978 | 9 | |||
979 | 10 | WINDOWS DEFINES: | ||
980 | 11 | The code specific to Windows should be wrapped around one of | ||
981 | 12 | the following #defines | ||
982 | 13 | |||
983 | 14 | MS_WIN64 - Code specific to the MS Win64 API | ||
984 | 15 | MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs) | ||
985 | 16 | MS_WINDOWS - Code specific to Windows, but all versions. | ||
986 | 17 | MS_WINCE - Code specific to Windows CE | ||
987 | 18 | Py_ENABLE_SHARED - Code if the Python core is built as a DLL. | ||
988 | 19 | |||
989 | 20 | Also note that neither "_M_IX86" or "_MSC_VER" should be used for | ||
990 | 21 | any purpose other than "Windows Intel x86 specific" and "Microsoft | ||
991 | 22 | compiler specific". Therefore, these should be very rare. | ||
992 | 23 | |||
993 | 24 | |||
994 | 25 | NOTE: The following symbols are deprecated: | ||
995 | 26 | NT, USE_DL_EXPORT, USE_DL_IMPORT, DL_EXPORT, DL_IMPORT | ||
996 | 27 | MS_CORE_DLL. | ||
997 | 28 | |||
998 | 29 | WIN32 is still required for the locale module. | ||
999 | 30 | |||
1000 | 31 | */ | ||
1001 | 32 | |||
1002 | 33 | #ifdef _WIN32_WCE | ||
1003 | 34 | #define MS_WINCE | ||
1004 | 35 | #endif | ||
1005 | 36 | |||
1006 | 37 | /* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */ | ||
1007 | 38 | #ifdef USE_DL_EXPORT | ||
1008 | 39 | # define Py_BUILD_CORE | ||
1009 | 40 | #endif /* USE_DL_EXPORT */ | ||
1010 | 41 | |||
1011 | 42 | /* Visual Studio 2005 introduces deprecation warnings for | ||
1012 | 43 | "insecure" and POSIX functions. The insecure functions should | ||
1013 | 44 | be replaced by *_s versions (according to Microsoft); the | ||
1014 | 45 | POSIX functions by _* versions (which, according to Microsoft, | ||
1015 | 46 | would be ISO C conforming). Neither renaming is feasible, so | ||
1016 | 47 | we just silence the warnings. */ | ||
1017 | 48 | |||
1018 | 49 | #ifndef _CRT_SECURE_NO_DEPRECATE | ||
1019 | 50 | #define _CRT_SECURE_NO_DEPRECATE 1 | ||
1020 | 51 | #endif | ||
1021 | 52 | #ifndef _CRT_NONSTDC_NO_DEPRECATE | ||
1022 | 53 | #define _CRT_NONSTDC_NO_DEPRECATE 1 | ||
1023 | 54 | #endif | ||
1024 | 55 | |||
1025 | 56 | /* Windows CE does not have these */ | ||
1026 | 57 | #ifndef MS_WINCE | ||
1027 | 58 | #define HAVE_IO_H | ||
1028 | 59 | #define HAVE_SYS_UTIME_H | ||
1029 | 60 | #define HAVE_TEMPNAM | ||
1030 | 61 | #define HAVE_TMPFILE | ||
1031 | 62 | #define HAVE_TMPNAM | ||
1032 | 63 | #define HAVE_CLOCK | ||
1033 | 64 | #define HAVE_STRERROR | ||
1034 | 65 | #endif | ||
1035 | 66 | |||
1036 | 67 | #ifdef HAVE_IO_H | ||
1037 | 68 | #include <io.h> | ||
1038 | 69 | #endif | ||
1039 | 70 | |||
1040 | 71 | #define HAVE_HYPOT | ||
1041 | 72 | #define HAVE_STRFTIME | ||
1042 | 73 | #define DONT_HAVE_SIG_ALARM | ||
1043 | 74 | #define DONT_HAVE_SIG_PAUSE | ||
1044 | 75 | #define LONG_BIT 32 | ||
1045 | 76 | #define WORD_BIT 32 | ||
1046 | 77 | #define PREFIX "" | ||
1047 | 78 | #define EXEC_PREFIX "" | ||
1048 | 79 | |||
1049 | 80 | #define MS_WIN32 /* only support win32 and greater. */ | ||
1050 | 81 | #define MS_WINDOWS | ||
1051 | 82 | #ifndef PYTHONPATH | ||
1052 | 83 | # define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk" | ||
1053 | 84 | #endif | ||
1054 | 85 | #define NT_THREADS | ||
1055 | 86 | #define WITH_THREAD | ||
1056 | 87 | #ifndef NETSCAPE_PI | ||
1057 | 88 | #define USE_SOCKET | ||
1058 | 89 | #endif | ||
1059 | 90 | |||
1060 | 91 | /* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */ | ||
1061 | 92 | #if defined(MS_WINCE) | ||
1062 | 93 | # include <stdlib.h> | ||
1063 | 94 | # define strdup _strdup | ||
1064 | 95 | #endif | ||
1065 | 96 | |||
1066 | 97 | #ifdef MS_WINCE | ||
1067 | 98 | /* Windows CE does not support environment variables */ | ||
1068 | 99 | #define getenv(v) (NULL) | ||
1069 | 100 | #define environ (NULL) | ||
1070 | 101 | #endif | ||
1071 | 102 | |||
1072 | 103 | /* Compiler specific defines */ | ||
1073 | 104 | |||
1074 | 105 | /* ------------------------------------------------------------------------*/ | ||
1075 | 106 | /* Microsoft C defines _MSC_VER */ | ||
1076 | 107 | #ifdef _MSC_VER | ||
1077 | 108 | |||
1078 | 109 | /* We want COMPILER to expand to a string containing _MSC_VER's *value*. | ||
1079 | 110 | * This is horridly tricky, because the stringization operator only works | ||
1080 | 111 | * on macro arguments, and doesn't evaluate macros passed *as* arguments. | ||
1081 | 112 | * Attempts simpler than the following appear doomed to produce "_MSC_VER" | ||
1082 | 113 | * literally in the string. | ||
1083 | 114 | */ | ||
1084 | 115 | #define _Py_PASTE_VERSION(SUFFIX) \ | ||
1085 | 116 | ("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]") | ||
1086 | 117 | /* e.g., this produces, after compile-time string catenation, | ||
1087 | 118 | * ("[MSC v.1200 32 bit (Intel)]") | ||
1088 | 119 | * | ||
1089 | 120 | * _Py_STRINGIZE(_MSC_VER) expands to | ||
1090 | 121 | * _Py_STRINGIZE1((_MSC_VER)) expands to | ||
1091 | 122 | * _Py_STRINGIZE2(_MSC_VER) but as this call is the result of token-pasting | ||
1092 | 123 | * it's scanned again for macros and so further expands to (under MSVC 6) | ||
1093 | 124 | * _Py_STRINGIZE2(1200) which then expands to | ||
1094 | 125 | * "1200" | ||
1095 | 126 | */ | ||
1096 | 127 | #define _Py_STRINGIZE(X) _Py_STRINGIZE1((X)) | ||
1097 | 128 | #define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X | ||
1098 | 129 | #define _Py_STRINGIZE2(X) #X | ||
1099 | 130 | |||
1100 | 131 | /* MSVC defines _WINxx to differentiate the windows platform types | ||
1101 | 132 | |||
1102 | 133 | Note that for compatibility reasons _WIN32 is defined on Win32 | ||
1103 | 134 | *and* on Win64. For the same reasons, in Python, MS_WIN32 is | ||
1104 | 135 | defined on Win32 *and* Win64. Win32 only code must therefore be | ||
1105 | 136 | guarded as follows: | ||
1106 | 137 | #if defined(MS_WIN32) && !defined(MS_WIN64) | ||
1107 | 138 | Some modules are disabled on Itanium processors, therefore we | ||
1108 | 139 | have MS_WINI64 set for those targets, otherwise MS_WINX64 | ||
1109 | 140 | */ | ||
1110 | 141 | #ifdef _WIN64 | ||
1111 | 142 | #define MS_WIN64 | ||
1112 | 143 | #endif | ||
1113 | 144 | |||
1114 | 145 | /* set the COMPILER */ | ||
1115 | 146 | #ifdef MS_WIN64 | ||
1116 | 147 | #if defined(_M_IA64) | ||
1117 | 148 | #define COMPILER _Py_PASTE_VERSION("64 bit (Itanium)") | ||
1118 | 149 | #define MS_WINI64 | ||
1119 | 150 | #elif defined(_M_X64) || defined(_M_AMD64) | ||
1120 | 151 | #define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)") | ||
1121 | 152 | #define MS_WINX64 | ||
1122 | 153 | #else | ||
1123 | 154 | #define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)") | ||
1124 | 155 | #endif | ||
1125 | 156 | #endif /* MS_WIN64 */ | ||
1126 | 157 | |||
1127 | 158 | /* set the version macros for the windows headers */ | ||
1128 | 159 | #ifdef MS_WINX64 | ||
1129 | 160 | /* 64 bit only runs on XP or greater */ | ||
1130 | 161 | #define Py_WINVER _WIN32_WINNT_WINXP | ||
1131 | 162 | #define Py_NTDDI NTDDI_WINXP | ||
1132 | 163 | #else | ||
1133 | 164 | /* Python 2.6+ requires Windows 2000 or greater */ | ||
1134 | 165 | #ifdef _WIN32_WINNT_WIN2K | ||
1135 | 166 | #define Py_WINVER _WIN32_WINNT_WIN2K | ||
1136 | 167 | #else | ||
1137 | 168 | #define Py_WINVER 0x0500 | ||
1138 | 169 | #endif | ||
1139 | 170 | #define Py_NTDDI NTDDI_WIN2KSP4 | ||
1140 | 171 | #endif | ||
1141 | 172 | |||
1142 | 173 | /* We only set these values when building Python - we don't want to force | ||
1143 | 174 | these values on extensions, as that will affect the prototypes and | ||
1144 | 175 | structures exposed in the Windows headers. Even when building Python, we | ||
1145 | 176 | allow a single source file to override this - they may need access to | ||
1146 | 177 | structures etc so it can optionally use new Windows features if it | ||
1147 | 178 | determines at runtime they are available. | ||
1148 | 179 | */ | ||
1149 | 180 | #if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_MODULE) | ||
1150 | 181 | #ifndef NTDDI_VERSION | ||
1151 | 182 | #define NTDDI_VERSION Py_NTDDI | ||
1152 | 183 | #endif | ||
1153 | 184 | #ifndef WINVER | ||
1154 | 185 | #define WINVER Py_WINVER | ||
1155 | 186 | #endif | ||
1156 | 187 | #ifndef _WIN32_WINNT | ||
1157 | 188 | #define _WIN32_WINNT Py_WINVER | ||
1158 | 189 | #endif | ||
1159 | 190 | #endif | ||
1160 | 191 | |||
1161 | 192 | /* _W64 is not defined for VC6 or eVC4 */ | ||
1162 | 193 | #ifndef _W64 | ||
1163 | 194 | #define _W64 | ||
1164 | 195 | #endif | ||
1165 | 196 | |||
1166 | 197 | /* Define like size_t, omitting the "unsigned" */ | ||
1167 | 198 | #ifdef MS_WIN64 | ||
1168 | 199 | typedef __int64 ssize_t; | ||
1169 | 200 | #else | ||
1170 | 201 | typedef _W64 int ssize_t; | ||
1171 | 202 | #endif | ||
1172 | 203 | #define HAVE_SSIZE_T 1 | ||
1173 | 204 | |||
1174 | 205 | #if defined(MS_WIN32) && !defined(MS_WIN64) | ||
1175 | 206 | #ifdef _M_IX86 | ||
1176 | 207 | #define COMPILER _Py_PASTE_VERSION("32 bit (Intel)") | ||
1177 | 208 | #else | ||
1178 | 209 | #define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)") | ||
1179 | 210 | #endif | ||
1180 | 211 | #endif /* MS_WIN32 && !MS_WIN64 */ | ||
1181 | 212 | |||
1182 | 213 | typedef int pid_t; | ||
1183 | 214 | |||
1184 | 215 | #include <float.h> | ||
1185 | 216 | #define Py_IS_NAN _isnan | ||
1186 | 217 | #define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X)) | ||
1187 | 218 | #define Py_IS_FINITE(X) _finite(X) | ||
1188 | 219 | #define copysign _copysign | ||
1189 | 220 | #define hypot _hypot | ||
1190 | 221 | |||
1191 | 222 | #endif /* _MSC_VER */ | ||
1192 | 223 | |||
1193 | 224 | /* define some ANSI types that are not defined in earlier Win headers */ | ||
1194 | 225 | #if defined(_MSC_VER) && _MSC_VER >= 1200 | ||
1195 | 226 | /* This file only exists in VC 6.0 or higher */ | ||
1196 | 227 | #include <basetsd.h> | ||
1197 | 228 | #endif | ||
1198 | 229 | |||
1199 | 230 | /* ------------------------------------------------------------------------*/ | ||
1200 | 231 | /* The Borland compiler defines __BORLANDC__ */ | ||
1201 | 232 | /* XXX These defines are likely incomplete, but should be easy to fix. */ | ||
1202 | 233 | #ifdef __BORLANDC__ | ||
1203 | 234 | #define COMPILER "[Borland]" | ||
1204 | 235 | |||
1205 | 236 | #ifdef _WIN32 | ||
1206 | 237 | /* tested with BCC 5.5 (__BORLANDC__ >= 0x0550) | ||
1207 | 238 | */ | ||
1208 | 239 | |||
1209 | 240 | typedef int pid_t; | ||
1210 | 241 | /* BCC55 seems to understand __declspec(dllimport), it is used in its | ||
1211 | 242 | own header files (winnt.h, ...) - so we can do nothing and get the default*/ | ||
1212 | 243 | |||
1213 | 244 | #undef HAVE_SYS_UTIME_H | ||
1214 | 245 | #define HAVE_UTIME_H | ||
1215 | 246 | #define HAVE_DIRENT_H | ||
1216 | 247 | |||
1217 | 248 | /* rename a few functions for the Borland compiler */ | ||
1218 | 249 | #include <io.h> | ||
1219 | 250 | #define _chsize chsize | ||
1220 | 251 | #define _setmode setmode | ||
1221 | 252 | |||
1222 | 253 | #else /* !_WIN32 */ | ||
1223 | 254 | #error "Only Win32 and later are supported" | ||
1224 | 255 | #endif /* !_WIN32 */ | ||
1225 | 256 | |||
1226 | 257 | #endif /* BORLANDC */ | ||
1227 | 258 | |||
1228 | 259 | /* ------------------------------------------------------------------------*/ | ||
1229 | 260 | /* egcs/gnu-win32 defines __GNUC__ and _WIN32 */ | ||
1230 | 261 | #if defined(__GNUC__) && defined(_WIN32) | ||
1231 | 262 | /* XXX These defines are likely incomplete, but should be easy to fix. | ||
1232 | 263 | They should be complete enough to build extension modules. */ | ||
1233 | 264 | /* Suggested by Rene Liebscher <R.Liebscher@gmx.de> to avoid a GCC 2.91.* | ||
1234 | 265 | bug that requires structure imports. More recent versions of the | ||
1235 | 266 | compiler don't exhibit this bug. | ||
1236 | 267 | */ | ||
1237 | 268 | #if (__GNUC__==2) && (__GNUC_MINOR__<=91) | ||
1238 | 269 | #warning "Please use an up-to-date version of gcc! (>2.91 recommended)" | ||
1239 | 270 | #endif | ||
1240 | 271 | |||
1241 | 272 | #define COMPILER "[gcc]" | ||
1242 | 273 | #define hypot _hypot | ||
1243 | 274 | #define PY_LONG_LONG long long | ||
1244 | 275 | #define PY_LLONG_MIN LLONG_MIN | ||
1245 | 276 | #define PY_LLONG_MAX LLONG_MAX | ||
1246 | 277 | #define PY_ULLONG_MAX ULLONG_MAX | ||
1247 | 278 | #endif /* GNUC */ | ||
1248 | 279 | |||
1249 | 280 | /* ------------------------------------------------------------------------*/ | ||
1250 | 281 | /* lcc-win32 defines __LCC__ */ | ||
1251 | 282 | #if defined(__LCC__) | ||
1252 | 283 | /* XXX These defines are likely incomplete, but should be easy to fix. | ||
1253 | 284 | They should be complete enough to build extension modules. */ | ||
1254 | 285 | |||
1255 | 286 | #define COMPILER "[lcc-win32]" | ||
1256 | 287 | typedef int pid_t; | ||
1257 | 288 | /* __declspec() is supported here too - do nothing to get the defaults */ | ||
1258 | 289 | |||
1259 | 290 | #endif /* LCC */ | ||
1260 | 291 | |||
1261 | 292 | /* ------------------------------------------------------------------------*/ | ||
1262 | 293 | /* End of compilers - finish up */ | ||
1263 | 294 | |||
1264 | 295 | #ifndef NO_STDIO_H | ||
1265 | 296 | # include <stdio.h> | ||
1266 | 297 | #endif | ||
1267 | 298 | |||
1268 | 299 | /* 64 bit ints are usually spelt __int64 unless compiler has overridden */ | ||
1269 | 300 | #define HAVE_LONG_LONG 1 | ||
1270 | 301 | #ifndef PY_LONG_LONG | ||
1271 | 302 | # define PY_LONG_LONG __int64 | ||
1272 | 303 | # define PY_LLONG_MAX _I64_MAX | ||
1273 | 304 | # define PY_LLONG_MIN _I64_MIN | ||
1274 | 305 | # define PY_ULLONG_MAX _UI64_MAX | ||
1275 | 306 | #endif | ||
1276 | 307 | |||
1277 | 308 | /* For Windows the Python core is in a DLL by default. Test | ||
1278 | 309 | Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ | ||
1279 | 310 | #if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED) | ||
1280 | 311 | # define Py_ENABLE_SHARED 1 /* standard symbol for shared library */ | ||
1281 | 312 | # define MS_COREDLL /* deprecated old symbol */ | ||
1282 | 313 | #endif /* !MS_NO_COREDLL && ... */ | ||
1283 | 314 | |||
1284 | 315 | /* All windows compilers that use this header support __declspec */ | ||
1285 | 316 | #define HAVE_DECLSPEC_DLL | ||
1286 | 317 | |||
1287 | 318 | /* For an MSVC DLL, we can nominate the .lib files used by extensions */ | ||
1288 | 319 | #ifdef MS_COREDLL | ||
1289 | 320 | # ifndef Py_BUILD_CORE /* not building the core - must be an ext */ | ||
1290 | 321 | # if defined(_MSC_VER) | ||
1291 | 322 | /* So MSVC users need not specify the .lib file in | ||
1292 | 323 | their Makefile (other compilers are generally | ||
1293 | 324 | taken care of by distutils.) */ | ||
1294 | 325 | # ifdef _DEBUG | ||
1295 | 326 | # pragma comment(lib,"python27.lib") | ||
1296 | 327 | # else | ||
1297 | 328 | # pragma comment(lib,"python27.lib") | ||
1298 | 329 | # endif /* _DEBUG */ | ||
1299 | 330 | # endif /* _MSC_VER */ | ||
1300 | 331 | # endif /* Py_BUILD_CORE */ | ||
1301 | 332 | #endif /* MS_COREDLL */ | ||
1302 | 333 | |||
1303 | 334 | #if defined(MS_WIN64) | ||
1304 | 335 | /* maintain "win32" sys.platform for backward compatibility of Python code, | ||
1305 | 336 | the Win64 API should be close enough to the Win32 API to make this | ||
1306 | 337 | preferable */ | ||
1307 | 338 | # define PLATFORM "win32" | ||
1308 | 339 | # define SIZEOF_VOID_P 8 | ||
1309 | 340 | # define SIZEOF_TIME_T 8 | ||
1310 | 341 | # define SIZEOF_OFF_T 4 | ||
1311 | 342 | # define SIZEOF_FPOS_T 8 | ||
1312 | 343 | # define SIZEOF_HKEY 8 | ||
1313 | 344 | # define SIZEOF_SIZE_T 8 | ||
1314 | 345 | /* configure.in defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG, | ||
1315 | 346 | sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t). | ||
1316 | 347 | On Win64 the second condition is not true, but if fpos_t replaces off_t | ||
1317 | 348 | then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64 | ||
1318 | 349 | should define this. */ | ||
1319 | 350 | # define HAVE_LARGEFILE_SUPPORT | ||
1320 | 351 | #elif defined(MS_WIN32) | ||
1321 | 352 | # define PLATFORM "win32" | ||
1322 | 353 | # define HAVE_LARGEFILE_SUPPORT | ||
1323 | 354 | # define SIZEOF_VOID_P 4 | ||
1324 | 355 | # define SIZEOF_OFF_T 4 | ||
1325 | 356 | # define SIZEOF_FPOS_T 8 | ||
1326 | 357 | # define SIZEOF_HKEY 4 | ||
1327 | 358 | # define SIZEOF_SIZE_T 4 | ||
1328 | 359 | /* MS VS2005 changes time_t to an 64-bit type on all platforms */ | ||
1329 | 360 | # if defined(_MSC_VER) && _MSC_VER >= 1400 | ||
1330 | 361 | # define SIZEOF_TIME_T 8 | ||
1331 | 362 | # else | ||
1332 | 363 | # define SIZEOF_TIME_T 4 | ||
1333 | 364 | # endif | ||
1334 | 365 | #endif | ||
1335 | 366 | |||
1336 | 367 | #ifdef _DEBUG | ||
1337 | 368 | //# define Py_DEBUG | ||
1338 | 369 | #endif | ||
1339 | 370 | |||
1340 | 371 | |||
1341 | 372 | #ifdef MS_WIN32 | ||
1342 | 373 | |||
1343 | 374 | #define SIZEOF_SHORT 2 | ||
1344 | 375 | #define SIZEOF_INT 4 | ||
1345 | 376 | #define SIZEOF_LONG 4 | ||
1346 | 377 | #define SIZEOF_LONG_LONG 8 | ||
1347 | 378 | #define SIZEOF_DOUBLE 8 | ||
1348 | 379 | #define SIZEOF_FLOAT 4 | ||
1349 | 380 | |||
1350 | 381 | /* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200. | ||
1351 | 382 | Microsoft eMbedded Visual C++ 4.0 has a version number of 1201 and doesn't | ||
1352 | 383 | define these. | ||
1353 | 384 | If some compiler does not provide them, modify the #if appropriately. */ | ||
1354 | 385 | #if defined(_MSC_VER) | ||
1355 | 386 | #if _MSC_VER > 1300 | ||
1356 | 387 | #define HAVE_UINTPTR_T 1 | ||
1357 | 388 | #define HAVE_INTPTR_T 1 | ||
1358 | 389 | #else | ||
1359 | 390 | /* VC6, VS 2002 and eVC4 don't support the C99 LL suffix for 64-bit integer literals */ | ||
1360 | 391 | #define Py_LL(x) x##I64 | ||
1361 | 392 | #endif /* _MSC_VER > 1200 */ | ||
1362 | 393 | #endif /* _MSC_VER */ | ||
1363 | 394 | |||
1364 | 395 | #endif | ||
1365 | 396 | |||
1366 | 397 | /* define signed and unsigned exact-width 32-bit and 64-bit types, used in the | ||
1367 | 398 | implementation of Python long integers. */ | ||
1368 | 399 | #ifndef PY_UINT32_T | ||
1369 | 400 | #if SIZEOF_INT == 4 | ||
1370 | 401 | #define HAVE_UINT32_T 1 | ||
1371 | 402 | #define PY_UINT32_T unsigned int | ||
1372 | 403 | #elif SIZEOF_LONG == 4 | ||
1373 | 404 | #define HAVE_UINT32_T 1 | ||
1374 | 405 | #define PY_UINT32_T unsigned long | ||
1375 | 406 | #endif | ||
1376 | 407 | #endif | ||
1377 | 408 | |||
1378 | 409 | #ifndef PY_UINT64_T | ||
1379 | 410 | #if SIZEOF_LONG_LONG == 8 | ||
1380 | 411 | #define HAVE_UINT64_T 1 | ||
1381 | 412 | #define PY_UINT64_T unsigned PY_LONG_LONG | ||
1382 | 413 | #endif | ||
1383 | 414 | #endif | ||
1384 | 415 | |||
1385 | 416 | #ifndef PY_INT32_T | ||
1386 | 417 | #if SIZEOF_INT == 4 | ||
1387 | 418 | #define HAVE_INT32_T 1 | ||
1388 | 419 | #define PY_INT32_T int | ||
1389 | 420 | #elif SIZEOF_LONG == 4 | ||
1390 | 421 | #define HAVE_INT32_T 1 | ||
1391 | 422 | #define PY_INT32_T long | ||
1392 | 423 | #endif | ||
1393 | 424 | #endif | ||
1394 | 425 | |||
1395 | 426 | #ifndef PY_INT64_T | ||
1396 | 427 | #if SIZEOF_LONG_LONG == 8 | ||
1397 | 428 | #define HAVE_INT64_T 1 | ||
1398 | 429 | #define PY_INT64_T PY_LONG_LONG | ||
1399 | 430 | #endif | ||
1400 | 431 | #endif | ||
1401 | 432 | |||
1402 | 433 | /* Fairly standard from here! */ | ||
1403 | 434 | |||
1404 | 435 | /* Define to 1 if you have the `copysign' function. */ | ||
1405 | 436 | #define HAVE_COPYSIGN 1 | ||
1406 | 437 | |||
1407 | 438 | /* Define to 1 if you have the `isinf' macro. */ | ||
1408 | 439 | #define HAVE_DECL_ISINF 1 | ||
1409 | 440 | |||
1410 | 441 | /* Define to 1 if you have the `isnan' function. */ | ||
1411 | 442 | #define HAVE_DECL_ISNAN 1 | ||
1412 | 443 | |||
1413 | 444 | /* Define if on AIX 3. | ||
1414 | 445 | System headers sometimes define this. | ||
1415 | 446 | We just want to avoid a redefinition error message. */ | ||
1416 | 447 | #ifndef _ALL_SOURCE | ||
1417 | 448 | /* #undef _ALL_SOURCE */ | ||
1418 | 449 | #endif | ||
1419 | 450 | |||
1420 | 451 | /* Define to empty if the keyword does not work. */ | ||
1421 | 452 | /* #define const */ | ||
1422 | 453 | |||
1423 | 454 | /* Define to 1 if you have the <conio.h> header file. */ | ||
1424 | 455 | #ifndef MS_WINCE | ||
1425 | 456 | #define HAVE_CONIO_H 1 | ||
1426 | 457 | #endif | ||
1427 | 458 | |||
1428 | 459 | /* Define to 1 if you have the <direct.h> header file. */ | ||
1429 | 460 | #ifndef MS_WINCE | ||
1430 | 461 | #define HAVE_DIRECT_H 1 | ||
1431 | 462 | #endif | ||
1432 | 463 | |||
1433 | 464 | /* Define if you have dirent.h. */ | ||
1434 | 465 | /* #define DIRENT 1 */ | ||
1435 | 466 | |||
1436 | 467 | /* Define to the type of elements in the array set by `getgroups'. | ||
1437 | 468 | Usually this is either `int' or `gid_t'. */ | ||
1438 | 469 | /* #undef GETGROUPS_T */ | ||
1439 | 470 | |||
1440 | 471 | /* Define to `int' if <sys/types.h> doesn't define. */ | ||
1441 | 472 | /* #undef gid_t */ | ||
1442 | 473 | |||
1443 | 474 | /* Define if your struct tm has tm_zone. */ | ||
1444 | 475 | /* #undef HAVE_TM_ZONE */ | ||
1445 | 476 | |||
1446 | 477 | /* Define if you don't have tm_zone but do have the external array | ||
1447 | 478 | tzname. */ | ||
1448 | 479 | #define HAVE_TZNAME | ||
1449 | 480 | |||
1450 | 481 | /* Define to `int' if <sys/types.h> doesn't define. */ | ||
1451 | 482 | /* #undef mode_t */ | ||
1452 | 483 | |||
1453 | 484 | /* Define if you don't have dirent.h, but have ndir.h. */ | ||
1454 | 485 | /* #undef NDIR */ | ||
1455 | 486 | |||
1456 | 487 | /* Define to `long' if <sys/types.h> doesn't define. */ | ||
1457 | 488 | /* #undef off_t */ | ||
1458 | 489 | |||
1459 | 490 | /* Define to `int' if <sys/types.h> doesn't define. */ | ||
1460 | 491 | /* #undef pid_t */ | ||
1461 | 492 | |||
1462 | 493 | /* Define if the system does not provide POSIX.1 features except | ||
1463 | 494 | with this defined. */ | ||
1464 | 495 | /* #undef _POSIX_1_SOURCE */ | ||
1465 | 496 | |||
1466 | 497 | /* Define if you need to in order for stat and other things to work. */ | ||
1467 | 498 | /* #undef _POSIX_SOURCE */ | ||
1468 | 499 | |||
1469 | 500 | /* Define as the return type of signal handlers (int or void). */ | ||
1470 | 501 | #define RETSIGTYPE void | ||
1471 | 502 | |||
1472 | 503 | /* Define to `unsigned' if <sys/types.h> doesn't define. */ | ||
1473 | 504 | /* #undef size_t */ | ||
1474 | 505 | |||
1475 | 506 | /* Define if you have the ANSI C header files. */ | ||
1476 | 507 | #define STDC_HEADERS 1 | ||
1477 | 508 | |||
1478 | 509 | /* Define if you don't have dirent.h, but have sys/dir.h. */ | ||
1479 | 510 | /* #undef SYSDIR */ | ||
1480 | 511 | |||
1481 | 512 | /* Define if you don't have dirent.h, but have sys/ndir.h. */ | ||
1482 | 513 | /* #undef SYSNDIR */ | ||
1483 | 514 | |||
1484 | 515 | /* Define if you can safely include both <sys/time.h> and <time.h>. */ | ||
1485 | 516 | /* #undef TIME_WITH_SYS_TIME */ | ||
1486 | 517 | |||
1487 | 518 | /* Define if your <sys/time.h> declares struct tm. */ | ||
1488 | 519 | /* #define TM_IN_SYS_TIME 1 */ | ||
1489 | 520 | |||
1490 | 521 | /* Define to `int' if <sys/types.h> doesn't define. */ | ||
1491 | 522 | /* #undef uid_t */ | ||
1492 | 523 | |||
1493 | 524 | /* Define if the closedir function returns void instead of int. */ | ||
1494 | 525 | /* #undef VOID_CLOSEDIR */ | ||
1495 | 526 | |||
1496 | 527 | /* Define if getpgrp() must be called as getpgrp(0) | ||
1497 | 528 | and (consequently) setpgrp() as setpgrp(0, 0). */ | ||
1498 | 529 | /* #undef GETPGRP_HAVE_ARGS */ | ||
1499 | 530 | |||
1500 | 531 | /* Define this if your time.h defines altzone */ | ||
1501 | 532 | /* #define HAVE_ALTZONE */ | ||
1502 | 533 | |||
1503 | 534 | /* Define if you have the putenv function. */ | ||
1504 | 535 | #ifndef MS_WINCE | ||
1505 | 536 | #define HAVE_PUTENV | ||
1506 | 537 | #endif | ||
1507 | 538 | |||
1508 | 539 | /* Define if your compiler supports function prototypes */ | ||
1509 | 540 | #define HAVE_PROTOTYPES | ||
1510 | 541 | |||
1511 | 542 | /* Define if you can safely include both <sys/select.h> and <sys/time.h> | ||
1512 | 543 | (which you can't on SCO ODT 3.0). */ | ||
1513 | 544 | /* #undef SYS_SELECT_WITH_SYS_TIME */ | ||
1514 | 545 | |||
1515 | 546 | /* Define if you want documentation strings in extension modules */ | ||
1516 | 547 | #define WITH_DOC_STRINGS 1 | ||
1517 | 548 | |||
1518 | 549 | /* Define if you want to compile in rudimentary thread support */ | ||
1519 | 550 | /* #undef WITH_THREAD */ | ||
1520 | 551 | |||
1521 | 552 | /* Define if you want to use the GNU readline library */ | ||
1522 | 553 | /* #define WITH_READLINE 1 */ | ||
1523 | 554 | |||
1524 | 555 | /* Define if you want to have a Unicode type. */ | ||
1525 | 556 | #define Py_USING_UNICODE | ||
1526 | 557 | |||
1527 | 558 | /* Define as the size of the unicode type. */ | ||
1528 | 559 | /* This is enough for unicodeobject.h to do the "right thing" on Windows. */ | ||
1529 | 560 | #define Py_UNICODE_SIZE 2 | ||
1530 | 561 | |||
1531 | 562 | /* Use Python's own small-block memory-allocator. */ | ||
1532 | 563 | #define WITH_PYMALLOC 1 | ||
1533 | 564 | |||
1534 | 565 | /* Define if you have clock. */ | ||
1535 | 566 | /* #define HAVE_CLOCK */ | ||
1536 | 567 | |||
1537 | 568 | /* Define when any dynamic module loading is enabled */ | ||
1538 | 569 | #define HAVE_DYNAMIC_LOADING | ||
1539 | 570 | |||
1540 | 571 | /* Define if you have ftime. */ | ||
1541 | 572 | #ifndef MS_WINCE | ||
1542 | 573 | #define HAVE_FTIME | ||
1543 | 574 | #endif | ||
1544 | 575 | |||
1545 | 576 | /* Define if you have getpeername. */ | ||
1546 | 577 | #define HAVE_GETPEERNAME | ||
1547 | 578 | |||
1548 | 579 | /* Define if you have getpgrp. */ | ||
1549 | 580 | /* #undef HAVE_GETPGRP */ | ||
1550 | 581 | |||
1551 | 582 | /* Define if you have getpid. */ | ||
1552 | 583 | #ifndef MS_WINCE | ||
1553 | 584 | #define HAVE_GETPID | ||
1554 | 585 | #endif | ||
1555 | 586 | |||
1556 | 587 | /* Define if you have gettimeofday. */ | ||
1557 | 588 | /* #undef HAVE_GETTIMEOFDAY */ | ||
1558 | 589 | |||
1559 | 590 | /* Define if you have getwd. */ | ||
1560 | 591 | /* #undef HAVE_GETWD */ | ||
1561 | 592 | |||
1562 | 593 | /* Define if you have lstat. */ | ||
1563 | 594 | /* #undef HAVE_LSTAT */ | ||
1564 | 595 | |||
1565 | 596 | /* Define if you have the mktime function. */ | ||
1566 | 597 | #define HAVE_MKTIME | ||
1567 | 598 | |||
1568 | 599 | /* Define if you have nice. */ | ||
1569 | 600 | /* #undef HAVE_NICE */ | ||
1570 | 601 | |||
1571 | 602 | /* Define if you have readlink. */ | ||
1572 | 603 | /* #undef HAVE_READLINK */ | ||
1573 | 604 | |||
1574 | 605 | /* Define if you have select. */ | ||
1575 | 606 | /* #undef HAVE_SELECT */ | ||
1576 | 607 | |||
1577 | 608 | /* Define if you have setpgid. */ | ||
1578 | 609 | /* #undef HAVE_SETPGID */ | ||
1579 | 610 | |||
1580 | 611 | /* Define if you have setpgrp. */ | ||
1581 | 612 | /* #undef HAVE_SETPGRP */ | ||
1582 | 613 | |||
1583 | 614 | /* Define if you have setsid. */ | ||
1584 | 615 | /* #undef HAVE_SETSID */ | ||
1585 | 616 | |||
1586 | 617 | /* Define if you have setvbuf. */ | ||
1587 | 618 | #define HAVE_SETVBUF | ||
1588 | 619 | |||
1589 | 620 | /* Define if you have siginterrupt. */ | ||
1590 | 621 | /* #undef HAVE_SIGINTERRUPT */ | ||
1591 | 622 | |||
1592 | 623 | /* Define if you have symlink. */ | ||
1593 | 624 | /* #undef HAVE_SYMLINK */ | ||
1594 | 625 | |||
1595 | 626 | /* Define if you have tcgetpgrp. */ | ||
1596 | 627 | /* #undef HAVE_TCGETPGRP */ | ||
1597 | 628 | |||
1598 | 629 | /* Define if you have tcsetpgrp. */ | ||
1599 | 630 | /* #undef HAVE_TCSETPGRP */ | ||
1600 | 631 | |||
1601 | 632 | /* Define if you have times. */ | ||
1602 | 633 | /* #undef HAVE_TIMES */ | ||
1603 | 634 | |||
1604 | 635 | /* Define if you have uname. */ | ||
1605 | 636 | /* #undef HAVE_UNAME */ | ||
1606 | 637 | |||
1607 | 638 | /* Define if you have waitpid. */ | ||
1608 | 639 | /* #undef HAVE_WAITPID */ | ||
1609 | 640 | |||
1610 | 641 | /* Define to 1 if you have the `wcscoll' function. */ | ||
1611 | 642 | #ifndef MS_WINCE | ||
1612 | 643 | #define HAVE_WCSCOLL 1 | ||
1613 | 644 | #endif | ||
1614 | 645 | |||
1615 | 646 | /* Define if you have the <dlfcn.h> header file. */ | ||
1616 | 647 | /* #undef HAVE_DLFCN_H */ | ||
1617 | 648 | |||
1618 | 649 | /* Define to 1 if you have the <errno.h> header file. */ | ||
1619 | 650 | #ifndef MS_WINCE | ||
1620 | 651 | #define HAVE_ERRNO_H 1 | ||
1621 | 652 | #endif | ||
1622 | 653 | |||
1623 | 654 | /* Define if you have the <fcntl.h> header file. */ | ||
1624 | 655 | #ifndef MS_WINCE | ||
1625 | 656 | #define HAVE_FCNTL_H 1 | ||
1626 | 657 | #endif | ||
1627 | 658 | |||
1628 | 659 | /* Define to 1 if you have the <process.h> header file. */ | ||
1629 | 660 | #ifndef MS_WINCE | ||
1630 | 661 | #define HAVE_PROCESS_H 1 | ||
1631 | 662 | #endif | ||
1632 | 663 | |||
1633 | 664 | /* Define to 1 if you have the <signal.h> header file. */ | ||
1634 | 665 | #ifndef MS_WINCE | ||
1635 | 666 | #define HAVE_SIGNAL_H 1 | ||
1636 | 667 | #endif | ||
1637 | 668 | |||
1638 | 669 | /* Define if you have the <stdarg.h> prototypes. */ | ||
1639 | 670 | #define HAVE_STDARG_PROTOTYPES | ||
1640 | 671 | |||
1641 | 672 | /* Define if you have the <stddef.h> header file. */ | ||
1642 | 673 | #define HAVE_STDDEF_H 1 | ||
1643 | 674 | |||
1644 | 675 | /* Define if you have the <sys/audioio.h> header file. */ | ||
1645 | 676 | /* #undef HAVE_SYS_AUDIOIO_H */ | ||
1646 | 677 | |||
1647 | 678 | /* Define if you have the <sys/param.h> header file. */ | ||
1648 | 679 | /* #define HAVE_SYS_PARAM_H 1 */ | ||
1649 | 680 | |||
1650 | 681 | /* Define if you have the <sys/select.h> header file. */ | ||
1651 | 682 | /* #define HAVE_SYS_SELECT_H 1 */ | ||
1652 | 683 | |||
1653 | 684 | /* Define to 1 if you have the <sys/stat.h> header file. */ | ||
1654 | 685 | #ifndef MS_WINCE | ||
1655 | 686 | #define HAVE_SYS_STAT_H 1 | ||
1656 | 687 | #endif | ||
1657 | 688 | |||
1658 | 689 | /* Define if you have the <sys/time.h> header file. */ | ||
1659 | 690 | /* #define HAVE_SYS_TIME_H 1 */ | ||
1660 | 691 | |||
1661 | 692 | /* Define if you have the <sys/times.h> header file. */ | ||
1662 | 693 | /* #define HAVE_SYS_TIMES_H 1 */ | ||
1663 | 694 | |||
1664 | 695 | /* Define to 1 if you have the <sys/types.h> header file. */ | ||
1665 | 696 | #ifndef MS_WINCE | ||
1666 | 697 | #define HAVE_SYS_TYPES_H 1 | ||
1667 | 698 | #endif | ||
1668 | 699 | |||
1669 | 700 | /* Define if you have the <sys/un.h> header file. */ | ||
1670 | 701 | /* #define HAVE_SYS_UN_H 1 */ | ||
1671 | 702 | |||
1672 | 703 | /* Define if you have the <sys/utime.h> header file. */ | ||
1673 | 704 | /* #define HAVE_SYS_UTIME_H 1 */ | ||
1674 | 705 | |||
1675 | 706 | /* Define if you have the <sys/utsname.h> header file. */ | ||
1676 | 707 | /* #define HAVE_SYS_UTSNAME_H 1 */ | ||
1677 | 708 | |||
1678 | 709 | /* Define if you have the <thread.h> header file. */ | ||
1679 | 710 | /* #undef HAVE_THREAD_H */ | ||
1680 | 711 | |||
1681 | 712 | /* Define if you have the <unistd.h> header file. */ | ||
1682 | 713 | /* #define HAVE_UNISTD_H 1 */ | ||
1683 | 714 | |||
1684 | 715 | /* Define if you have the <utime.h> header file. */ | ||
1685 | 716 | /* #define HAVE_UTIME_H 1 */ | ||
1686 | 717 | |||
1687 | 718 | /* Define if the compiler provides a wchar.h header file. */ | ||
1688 | 719 | #define HAVE_WCHAR_H 1 | ||
1689 | 720 | |||
1690 | 721 | /* Define if you have the dl library (-ldl). */ | ||
1691 | 722 | /* #undef HAVE_LIBDL */ | ||
1692 | 723 | |||
1693 | 724 | /* Define if you have the mpc library (-lmpc). */ | ||
1694 | 725 | /* #undef HAVE_LIBMPC */ | ||
1695 | 726 | |||
1696 | 727 | /* Define if you have the nsl library (-lnsl). */ | ||
1697 | 728 | #define HAVE_LIBNSL 1 | ||
1698 | 729 | |||
1699 | 730 | /* Define if you have the seq library (-lseq). */ | ||
1700 | 731 | /* #undef HAVE_LIBSEQ */ | ||
1701 | 732 | |||
1702 | 733 | /* Define if you have the socket library (-lsocket). */ | ||
1703 | 734 | #define HAVE_LIBSOCKET 1 | ||
1704 | 735 | |||
1705 | 736 | /* Define if you have the sun library (-lsun). */ | ||
1706 | 737 | /* #undef HAVE_LIBSUN */ | ||
1707 | 738 | |||
1708 | 739 | /* Define if you have the termcap library (-ltermcap). */ | ||
1709 | 740 | /* #undef HAVE_LIBTERMCAP */ | ||
1710 | 741 | |||
1711 | 742 | /* Define if you have the termlib library (-ltermlib). */ | ||
1712 | 743 | /* #undef HAVE_LIBTERMLIB */ | ||
1713 | 744 | |||
1714 | 745 | /* Define if you have the thread library (-lthread). */ | ||
1715 | 746 | /* #undef HAVE_LIBTHREAD */ | ||
1716 | 747 | |||
1717 | 748 | /* WinSock does not use a bitmask in select, and uses | ||
1718 | 749 | socket handles greater than FD_SETSIZE */ | ||
1719 | 750 | #define Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE | ||
1720 | 751 | |||
1721 | 752 | /* Define if C doubles are 64-bit IEEE 754 binary format, stored with the | ||
1722 | 753 | least significant byte first */ | ||
1723 | 754 | #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1 | ||
1724 | 755 | |||
1725 | 756 | #endif /* !Py_CONFIG_H */ | ||
1726 | 757 | 0 | ||
1727 | === removed directory 'win_fix/Python33' | |||
1728 | === removed file 'win_fix/Python33/pyconfig.h' | |||
1729 | --- win_fix/Python33/pyconfig.h 2014-01-17 13:26:46 +0000 | |||
1730 | +++ win_fix/Python33/pyconfig.h 1970-01-01 00:00:00 +0000 | |||
1731 | @@ -1,765 +0,0 @@ | |||
1732 | 1 | #ifndef Py_CONFIG_H | ||
1733 | 2 | #define Py_CONFIG_H | ||
1734 | 3 | |||
1735 | 4 | /* pyconfig.h. NOT Generated automatically by configure. | ||
1736 | 5 | |||
1737 | 6 | This is a manually maintained version used for the Watcom, | ||
1738 | 7 | Borland and Microsoft Visual C++ compilers. It is a | ||
1739 | 8 | standard part of the Python distribution. | ||
1740 | 9 | |||
1741 | 10 | WINDOWS DEFINES: | ||
1742 | 11 | The code specific to Windows should be wrapped around one of | ||
1743 | 12 | the following #defines | ||
1744 | 13 | |||
1745 | 14 | MS_WIN64 - Code specific to the MS Win64 API | ||
1746 | 15 | MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs) | ||
1747 | 16 | MS_WINDOWS - Code specific to Windows, but all versions. | ||
1748 | 17 | MS_WINCE - Code specific to Windows CE | ||
1749 | 18 | Py_ENABLE_SHARED - Code if the Python core is built as a DLL. | ||
1750 | 19 | |||
1751 | 20 | Also note that neither "_M_IX86" or "_MSC_VER" should be used for | ||
1752 | 21 | any purpose other than "Windows Intel x86 specific" and "Microsoft | ||
1753 | 22 | compiler specific". Therefore, these should be very rare. | ||
1754 | 23 | |||
1755 | 24 | |||
1756 | 25 | NOTE: The following symbols are deprecated: | ||
1757 | 26 | NT, USE_DL_EXPORT, USE_DL_IMPORT, DL_EXPORT, DL_IMPORT | ||
1758 | 27 | MS_CORE_DLL. | ||
1759 | 28 | |||
1760 | 29 | WIN32 is still required for the locale module. | ||
1761 | 30 | |||
1762 | 31 | */ | ||
1763 | 32 | |||
1764 | 33 | #ifdef _WIN32_WCE | ||
1765 | 34 | #define MS_WINCE | ||
1766 | 35 | #endif | ||
1767 | 36 | |||
1768 | 37 | /* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */ | ||
1769 | 38 | #ifdef USE_DL_EXPORT | ||
1770 | 39 | # define Py_BUILD_CORE | ||
1771 | 40 | #endif /* USE_DL_EXPORT */ | ||
1772 | 41 | |||
1773 | 42 | /* Visual Studio 2005 introduces deprecation warnings for | ||
1774 | 43 | "insecure" and POSIX functions. The insecure functions should | ||
1775 | 44 | be replaced by *_s versions (according to Microsoft); the | ||
1776 | 45 | POSIX functions by _* versions (which, according to Microsoft, | ||
1777 | 46 | would be ISO C conforming). Neither renaming is feasible, so | ||
1778 | 47 | we just silence the warnings. */ | ||
1779 | 48 | |||
1780 | 49 | #ifndef _CRT_SECURE_NO_DEPRECATE | ||
1781 | 50 | #define _CRT_SECURE_NO_DEPRECATE 1 | ||
1782 | 51 | #endif | ||
1783 | 52 | #ifndef _CRT_NONSTDC_NO_DEPRECATE | ||
1784 | 53 | #define _CRT_NONSTDC_NO_DEPRECATE 1 | ||
1785 | 54 | #endif | ||
1786 | 55 | |||
1787 | 56 | /* Windows CE does not have these */ | ||
1788 | 57 | #ifndef MS_WINCE | ||
1789 | 58 | #define HAVE_IO_H | ||
1790 | 59 | #define HAVE_SYS_UTIME_H | ||
1791 | 60 | #define HAVE_TEMPNAM | ||
1792 | 61 | #define HAVE_TMPFILE | ||
1793 | 62 | #define HAVE_TMPNAM | ||
1794 | 63 | #define HAVE_CLOCK | ||
1795 | 64 | #define HAVE_STRERROR | ||
1796 | 65 | #endif | ||
1797 | 66 | |||
1798 | 67 | #ifdef HAVE_IO_H | ||
1799 | 68 | #include <io.h> | ||
1800 | 69 | #endif | ||
1801 | 70 | |||
1802 | 71 | #define HAVE_HYPOT | ||
1803 | 72 | #define HAVE_STRFTIME | ||
1804 | 73 | #define DONT_HAVE_SIG_ALARM | ||
1805 | 74 | #define DONT_HAVE_SIG_PAUSE | ||
1806 | 75 | #define LONG_BIT 32 | ||
1807 | 76 | #define WORD_BIT 32 | ||
1808 | 77 | #define PREFIX "" | ||
1809 | 78 | #define EXEC_PREFIX "" | ||
1810 | 79 | |||
1811 | 80 | #define MS_WIN32 /* only support win32 and greater. */ | ||
1812 | 81 | #define MS_WINDOWS | ||
1813 | 82 | #ifndef PYTHONPATH | ||
1814 | 83 | # define PYTHONPATH L".\\DLLs;.\\lib" | ||
1815 | 84 | #endif | ||
1816 | 85 | #define NT_THREADS | ||
1817 | 86 | #define WITH_THREAD | ||
1818 | 87 | #ifndef NETSCAPE_PI | ||
1819 | 88 | #define USE_SOCKET | ||
1820 | 89 | #endif | ||
1821 | 90 | |||
1822 | 91 | /* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */ | ||
1823 | 92 | #if defined(MS_WINCE) | ||
1824 | 93 | # include <stdlib.h> | ||
1825 | 94 | # define strdup _strdup | ||
1826 | 95 | #endif | ||
1827 | 96 | |||
1828 | 97 | #ifdef MS_WINCE | ||
1829 | 98 | /* Windows CE does not support environment variables */ | ||
1830 | 99 | #define getenv(v) (NULL) | ||
1831 | 100 | #define environ (NULL) | ||
1832 | 101 | #endif | ||
1833 | 102 | |||
1834 | 103 | /* Compiler specific defines */ | ||
1835 | 104 | |||
1836 | 105 | /* ------------------------------------------------------------------------*/ | ||
1837 | 106 | /* Microsoft C defines _MSC_VER */ | ||
1838 | 107 | #ifdef _MSC_VER | ||
1839 | 108 | |||
1840 | 109 | /* We want COMPILER to expand to a string containing _MSC_VER's *value*. | ||
1841 | 110 | * This is horridly tricky, because the stringization operator only works | ||
1842 | 111 | * on macro arguments, and doesn't evaluate macros passed *as* arguments. | ||
1843 | 112 | * Attempts simpler than the following appear doomed to produce "_MSC_VER" | ||
1844 | 113 | * literally in the string. | ||
1845 | 114 | */ | ||
1846 | 115 | #define _Py_PASTE_VERSION(SUFFIX) \ | ||
1847 | 116 | ("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]") | ||
1848 | 117 | /* e.g., this produces, after compile-time string catenation, | ||
1849 | 118 | * ("[MSC v.1200 32 bit (Intel)]") | ||
1850 | 119 | * | ||
1851 | 120 | * _Py_STRINGIZE(_MSC_VER) expands to | ||
1852 | 121 | * _Py_STRINGIZE1((_MSC_VER)) expands to | ||
1853 | 122 | * _Py_STRINGIZE2(_MSC_VER) but as this call is the result of token-pasting | ||
1854 | 123 | * it's scanned again for macros and so further expands to (under MSVC 6) | ||
1855 | 124 | * _Py_STRINGIZE2(1200) which then expands to | ||
1856 | 125 | * "1200" | ||
1857 | 126 | */ | ||
1858 | 127 | #define _Py_STRINGIZE(X) _Py_STRINGIZE1((X)) | ||
1859 | 128 | #define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X | ||
1860 | 129 | #define _Py_STRINGIZE2(X) #X | ||
1861 | 130 | |||
1862 | 131 | /* MSVC defines _WINxx to differentiate the windows platform types | ||
1863 | 132 | |||
1864 | 133 | Note that for compatibility reasons _WIN32 is defined on Win32 | ||
1865 | 134 | *and* on Win64. For the same reasons, in Python, MS_WIN32 is | ||
1866 | 135 | defined on Win32 *and* Win64. Win32 only code must therefore be | ||
1867 | 136 | guarded as follows: | ||
1868 | 137 | #if defined(MS_WIN32) && !defined(MS_WIN64) | ||
1869 | 138 | Some modules are disabled on Itanium processors, therefore we | ||
1870 | 139 | have MS_WINI64 set for those targets, otherwise MS_WINX64 | ||
1871 | 140 | */ | ||
1872 | 141 | #ifdef _WIN64 | ||
1873 | 142 | #define MS_WIN64 | ||
1874 | 143 | #endif | ||
1875 | 144 | |||
1876 | 145 | /* set the COMPILER */ | ||
1877 | 146 | #ifdef MS_WIN64 | ||
1878 | 147 | #if defined(_M_IA64) | ||
1879 | 148 | #define COMPILER _Py_PASTE_VERSION("64 bit (Itanium)") | ||
1880 | 149 | #define MS_WINI64 | ||
1881 | 150 | #elif defined(_M_X64) || defined(_M_AMD64) | ||
1882 | 151 | #define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)") | ||
1883 | 152 | #define MS_WINX64 | ||
1884 | 153 | #else | ||
1885 | 154 | #define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)") | ||
1886 | 155 | #endif | ||
1887 | 156 | #endif /* MS_WIN64 */ | ||
1888 | 157 | |||
1889 | 158 | /* set the version macros for the windows headers */ | ||
1890 | 159 | #ifdef MS_WINX64 | ||
1891 | 160 | /* 64 bit only runs on XP or greater */ | ||
1892 | 161 | #define Py_WINVER 0x0501 /* _WIN32_WINNT_WINXP */ | ||
1893 | 162 | #define Py_NTDDI NTDDI_WINXP | ||
1894 | 163 | #else | ||
1895 | 164 | /* Python 2.6+ requires Windows 2000 or greater */ | ||
1896 | 165 | #define Py_WINVER 0x0500 /* _WIN32_WINNT_WIN2K */ | ||
1897 | 166 | #define Py_NTDDI NTDDI_WIN2KSP4 | ||
1898 | 167 | #endif | ||
1899 | 168 | |||
1900 | 169 | /* We only set these values when building Python - we don't want to force | ||
1901 | 170 | these values on extensions, as that will affect the prototypes and | ||
1902 | 171 | structures exposed in the Windows headers. Even when building Python, we | ||
1903 | 172 | allow a single source file to override this - they may need access to | ||
1904 | 173 | structures etc so it can optionally use new Windows features if it | ||
1905 | 174 | determines at runtime they are available. | ||
1906 | 175 | */ | ||
1907 | 176 | #if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_MODULE) | ||
1908 | 177 | #ifndef NTDDI_VERSION | ||
1909 | 178 | #define NTDDI_VERSION Py_NTDDI | ||
1910 | 179 | #endif | ||
1911 | 180 | #ifndef WINVER | ||
1912 | 181 | #define WINVER Py_WINVER | ||
1913 | 182 | #endif | ||
1914 | 183 | #ifndef _WIN32_WINNT | ||
1915 | 184 | #define _WIN32_WINNT Py_WINVER | ||
1916 | 185 | #endif | ||
1917 | 186 | #endif | ||
1918 | 187 | |||
1919 | 188 | /* _W64 is not defined for VC6 or eVC4 */ | ||
1920 | 189 | #ifndef _W64 | ||
1921 | 190 | #define _W64 | ||
1922 | 191 | #endif | ||
1923 | 192 | |||
1924 | 193 | /* Define like size_t, omitting the "unsigned" */ | ||
1925 | 194 | #ifdef MS_WIN64 | ||
1926 | 195 | typedef __int64 ssize_t; | ||
1927 | 196 | #else | ||
1928 | 197 | typedef _W64 int ssize_t; | ||
1929 | 198 | #endif | ||
1930 | 199 | #define HAVE_SSIZE_T 1 | ||
1931 | 200 | |||
1932 | 201 | #if defined(MS_WIN32) && !defined(MS_WIN64) | ||
1933 | 202 | #ifdef _M_IX86 | ||
1934 | 203 | #define COMPILER _Py_PASTE_VERSION("32 bit (Intel)") | ||
1935 | 204 | #else | ||
1936 | 205 | #define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)") | ||
1937 | 206 | #endif | ||
1938 | 207 | #endif /* MS_WIN32 && !MS_WIN64 */ | ||
1939 | 208 | |||
1940 | 209 | typedef int pid_t; | ||
1941 | 210 | |||
1942 | 211 | #include <float.h> | ||
1943 | 212 | #define Py_IS_NAN _isnan | ||
1944 | 213 | #define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X)) | ||
1945 | 214 | #define Py_IS_FINITE(X) _finite(X) | ||
1946 | 215 | #define copysign _copysign | ||
1947 | 216 | #define hypot _hypot | ||
1948 | 217 | |||
1949 | 218 | /* Side by Side assemblies supported in VS 2005 and VS 2008 but not 2010*/ | ||
1950 | 219 | #if _MSC_VER >= 1400 && _MSC_VER < 1600 | ||
1951 | 220 | #define HAVE_SXS 1 | ||
1952 | 221 | #endif | ||
1953 | 222 | |||
1954 | 223 | /* define some ANSI types that are not defined in earlier Win headers */ | ||
1955 | 224 | #if _MSC_VER >= 1200 | ||
1956 | 225 | /* This file only exists in VC 6.0 or higher */ | ||
1957 | 226 | #include <basetsd.h> | ||
1958 | 227 | #endif | ||
1959 | 228 | |||
1960 | 229 | #endif /* _MSC_VER */ | ||
1961 | 230 | |||
1962 | 231 | /* ------------------------------------------------------------------------*/ | ||
1963 | 232 | /* The Borland compiler defines __BORLANDC__ */ | ||
1964 | 233 | /* XXX These defines are likely incomplete, but should be easy to fix. */ | ||
1965 | 234 | #ifdef __BORLANDC__ | ||
1966 | 235 | #define COMPILER "[Borland]" | ||
1967 | 236 | |||
1968 | 237 | #ifdef _WIN32 | ||
1969 | 238 | /* tested with BCC 5.5 (__BORLANDC__ >= 0x0550) | ||
1970 | 239 | */ | ||
1971 | 240 | |||
1972 | 241 | typedef int pid_t; | ||
1973 | 242 | /* BCC55 seems to understand __declspec(dllimport), it is used in its | ||
1974 | 243 | own header files (winnt.h, ...) - so we can do nothing and get the default*/ | ||
1975 | 244 | |||
1976 | 245 | #undef HAVE_SYS_UTIME_H | ||
1977 | 246 | #define HAVE_UTIME_H | ||
1978 | 247 | #define HAVE_DIRENT_H | ||
1979 | 248 | |||
1980 | 249 | /* rename a few functions for the Borland compiler */ | ||
1981 | 250 | #include <io.h> | ||
1982 | 251 | #define _chsize chsize | ||
1983 | 252 | #define _setmode setmode | ||
1984 | 253 | |||
1985 | 254 | #else /* !_WIN32 */ | ||
1986 | 255 | #error "Only Win32 and later are supported" | ||
1987 | 256 | #endif /* !_WIN32 */ | ||
1988 | 257 | |||
1989 | 258 | #endif /* BORLANDC */ | ||
1990 | 259 | |||
1991 | 260 | /* ------------------------------------------------------------------------*/ | ||
1992 | 261 | /* egcs/gnu-win32 defines __GNUC__ and _WIN32 */ | ||
1993 | 262 | #if defined(__GNUC__) && defined(_WIN32) | ||
1994 | 263 | /* XXX These defines are likely incomplete, but should be easy to fix. | ||
1995 | 264 | They should be complete enough to build extension modules. */ | ||
1996 | 265 | /* Suggested by Rene Liebscher <R.Liebscher@gmx.de> to avoid a GCC 2.91.* | ||
1997 | 266 | bug that requires structure imports. More recent versions of the | ||
1998 | 267 | compiler don't exhibit this bug. | ||
1999 | 268 | */ | ||
2000 | 269 | #if (__GNUC__==2) && (__GNUC_MINOR__<=91) | ||
2001 | 270 | #warning "Please use an up-to-date version of gcc! (>2.91 recommended)" | ||
2002 | 271 | #endif | ||
2003 | 272 | |||
2004 | 273 | #define COMPILER "[gcc]" | ||
2005 | 274 | #define hypot _hypot | ||
2006 | 275 | #define PY_LONG_LONG long long | ||
2007 | 276 | #define PY_LLONG_MIN LLONG_MIN | ||
2008 | 277 | #define PY_LLONG_MAX LLONG_MAX | ||
2009 | 278 | #define PY_ULLONG_MAX ULLONG_MAX | ||
2010 | 279 | #endif /* GNUC */ | ||
2011 | 280 | |||
2012 | 281 | /* ------------------------------------------------------------------------*/ | ||
2013 | 282 | /* lcc-win32 defines __LCC__ */ | ||
2014 | 283 | #if defined(__LCC__) | ||
2015 | 284 | /* XXX These defines are likely incomplete, but should be easy to fix. | ||
2016 | 285 | They should be complete enough to build extension modules. */ | ||
2017 | 286 | |||
2018 | 287 | #define COMPILER "[lcc-win32]" | ||
2019 | 288 | typedef int pid_t; | ||
2020 | 289 | /* __declspec() is supported here too - do nothing to get the defaults */ | ||
2021 | 290 | |||
2022 | 291 | #endif /* LCC */ | ||
2023 | 292 | |||
2024 | 293 | /* ------------------------------------------------------------------------*/ | ||
2025 | 294 | /* End of compilers - finish up */ | ||
2026 | 295 | |||
2027 | 296 | #ifndef NO_STDIO_H | ||
2028 | 297 | # include <stdio.h> | ||
2029 | 298 | #endif | ||
2030 | 299 | |||
2031 | 300 | /* 64 bit ints are usually spelt __int64 unless compiler has overridden */ | ||
2032 | 301 | #define HAVE_LONG_LONG 1 | ||
2033 | 302 | #ifndef PY_LONG_LONG | ||
2034 | 303 | # define PY_LONG_LONG __int64 | ||
2035 | 304 | # define PY_LLONG_MAX _I64_MAX | ||
2036 | 305 | # define PY_LLONG_MIN _I64_MIN | ||
2037 | 306 | # define PY_ULLONG_MAX _UI64_MAX | ||
2038 | 307 | #endif | ||
2039 | 308 | |||
2040 | 309 | /* For Windows the Python core is in a DLL by default. Test | ||
2041 | 310 | Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ | ||
2042 | 311 | #if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED) | ||
2043 | 312 | # define Py_ENABLE_SHARED 1 /* standard symbol for shared library */ | ||
2044 | 313 | # define MS_COREDLL /* deprecated old symbol */ | ||
2045 | 314 | #endif /* !MS_NO_COREDLL && ... */ | ||
2046 | 315 | |||
2047 | 316 | /* All windows compilers that use this header support __declspec */ | ||
2048 | 317 | #define HAVE_DECLSPEC_DLL | ||
2049 | 318 | |||
2050 | 319 | /* For an MSVC DLL, we can nominate the .lib files used by extensions */ | ||
2051 | 320 | #ifdef MS_COREDLL | ||
2052 | 321 | # ifndef Py_BUILD_CORE /* not building the core - must be an ext */ | ||
2053 | 322 | # if defined(_MSC_VER) | ||
2054 | 323 | /* So MSVC users need not specify the .lib file in | ||
2055 | 324 | their Makefile (other compilers are generally | ||
2056 | 325 | taken care of by distutils.) */ | ||
2057 | 326 | # if defined(_DEBUG) | ||
2058 | 327 | # pragma comment(lib,"python33.lib") | ||
2059 | 328 | # elif defined(Py_LIMITED_API) | ||
2060 | 329 | # pragma comment(lib,"python3.lib") | ||
2061 | 330 | # else | ||
2062 | 331 | # pragma comment(lib,"python33.lib") | ||
2063 | 332 | # endif /* _DEBUG */ | ||
2064 | 333 | # endif /* _MSC_VER */ | ||
2065 | 334 | # endif /* Py_BUILD_CORE */ | ||
2066 | 335 | #endif /* MS_COREDLL */ | ||
2067 | 336 | |||
2068 | 337 | #if defined(MS_WIN64) | ||
2069 | 338 | /* maintain "win32" sys.platform for backward compatibility of Python code, | ||
2070 | 339 | the Win64 API should be close enough to the Win32 API to make this | ||
2071 | 340 | preferable */ | ||
2072 | 341 | # define PLATFORM "win32" | ||
2073 | 342 | # define SIZEOF_VOID_P 8 | ||
2074 | 343 | # define SIZEOF_TIME_T 8 | ||
2075 | 344 | # define SIZEOF_OFF_T 4 | ||
2076 | 345 | # define SIZEOF_FPOS_T 8 | ||
2077 | 346 | # define SIZEOF_HKEY 8 | ||
2078 | 347 | # define SIZEOF_SIZE_T 8 | ||
2079 | 348 | /* configure.ac defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG, | ||
2080 | 349 | sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t). | ||
2081 | 350 | On Win64 the second condition is not true, but if fpos_t replaces off_t | ||
2082 | 351 | then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64 | ||
2083 | 352 | should define this. */ | ||
2084 | 353 | # define HAVE_LARGEFILE_SUPPORT | ||
2085 | 354 | #elif defined(MS_WIN32) | ||
2086 | 355 | # define PLATFORM "win32" | ||
2087 | 356 | # define HAVE_LARGEFILE_SUPPORT | ||
2088 | 357 | # define SIZEOF_VOID_P 4 | ||
2089 | 358 | # define SIZEOF_OFF_T 4 | ||
2090 | 359 | # define SIZEOF_FPOS_T 8 | ||
2091 | 360 | # define SIZEOF_HKEY 4 | ||
2092 | 361 | # define SIZEOF_SIZE_T 4 | ||
2093 | 362 | /* MS VS2005 changes time_t to an 64-bit type on all platforms */ | ||
2094 | 363 | # if defined(_MSC_VER) && _MSC_VER >= 1400 | ||
2095 | 364 | # define SIZEOF_TIME_T 8 | ||
2096 | 365 | # else | ||
2097 | 366 | # define SIZEOF_TIME_T 4 | ||
2098 | 367 | # endif | ||
2099 | 368 | #endif | ||
2100 | 369 | |||
2101 | 370 | #ifdef _DEBUG | ||
2102 | 371 | //# define Py_DEBUG | ||
2103 | 372 | #endif | ||
2104 | 373 | |||
2105 | 374 | |||
2106 | 375 | #ifdef MS_WIN32 | ||
2107 | 376 | |||
2108 | 377 | #define SIZEOF_SHORT 2 | ||
2109 | 378 | #define SIZEOF_INT 4 | ||
2110 | 379 | #define SIZEOF_LONG 4 | ||
2111 | 380 | #define SIZEOF_LONG_LONG 8 | ||
2112 | 381 | #define SIZEOF_DOUBLE 8 | ||
2113 | 382 | #define SIZEOF_FLOAT 4 | ||
2114 | 383 | |||
2115 | 384 | /* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200. | ||
2116 | 385 | Microsoft eMbedded Visual C++ 4.0 has a version number of 1201 and doesn't | ||
2117 | 386 | define these. | ||
2118 | 387 | If some compiler does not provide them, modify the #if appropriately. */ | ||
2119 | 388 | #if defined(_MSC_VER) | ||
2120 | 389 | #if _MSC_VER > 1300 | ||
2121 | 390 | #define HAVE_UINTPTR_T 1 | ||
2122 | 391 | #define HAVE_INTPTR_T 1 | ||
2123 | 392 | #else | ||
2124 | 393 | /* VC6, VS 2002 and eVC4 don't support the C99 LL suffix for 64-bit integer literals */ | ||
2125 | 394 | #define Py_LL(x) x##I64 | ||
2126 | 395 | #endif /* _MSC_VER > 1200 */ | ||
2127 | 396 | #endif /* _MSC_VER */ | ||
2128 | 397 | |||
2129 | 398 | #endif | ||
2130 | 399 | |||
2131 | 400 | /* define signed and unsigned exact-width 32-bit and 64-bit types, used in the | ||
2132 | 401 | implementation of Python long integers. */ | ||
2133 | 402 | #ifndef PY_UINT32_T | ||
2134 | 403 | #if SIZEOF_INT == 4 | ||
2135 | 404 | #define HAVE_UINT32_T 1 | ||
2136 | 405 | #define PY_UINT32_T unsigned int | ||
2137 | 406 | #elif SIZEOF_LONG == 4 | ||
2138 | 407 | #define HAVE_UINT32_T 1 | ||
2139 | 408 | #define PY_UINT32_T unsigned long | ||
2140 | 409 | #endif | ||
2141 | 410 | #endif | ||
2142 | 411 | |||
2143 | 412 | #ifndef PY_UINT64_T | ||
2144 | 413 | #if SIZEOF_LONG_LONG == 8 | ||
2145 | 414 | #define HAVE_UINT64_T 1 | ||
2146 | 415 | #define PY_UINT64_T unsigned PY_LONG_LONG | ||
2147 | 416 | #endif | ||
2148 | 417 | #endif | ||
2149 | 418 | |||
2150 | 419 | #ifndef PY_INT32_T | ||
2151 | 420 | #if SIZEOF_INT == 4 | ||
2152 | 421 | #define HAVE_INT32_T 1 | ||
2153 | 422 | #define PY_INT32_T int | ||
2154 | 423 | #elif SIZEOF_LONG == 4 | ||
2155 | 424 | #define HAVE_INT32_T 1 | ||
2156 | 425 | #define PY_INT32_T long | ||
2157 | 426 | #endif | ||
2158 | 427 | #endif | ||
2159 | 428 | |||
2160 | 429 | #ifndef PY_INT64_T | ||
2161 | 430 | #if SIZEOF_LONG_LONG == 8 | ||
2162 | 431 | #define HAVE_INT64_T 1 | ||
2163 | 432 | #define PY_INT64_T PY_LONG_LONG | ||
2164 | 433 | #endif | ||
2165 | 434 | #endif | ||
2166 | 435 | |||
2167 | 436 | /* Fairly standard from here! */ | ||
2168 | 437 | |||
2169 | 438 | /* Define to 1 if you have the `copysign' function. */ | ||
2170 | 439 | #define HAVE_COPYSIGN 1 | ||
2171 | 440 | |||
2172 | 441 | /* Define to 1 if you have the `isinf' macro. */ | ||
2173 | 442 | #define HAVE_DECL_ISINF 1 | ||
2174 | 443 | |||
2175 | 444 | /* Define to 1 if you have the `isnan' function. */ | ||
2176 | 445 | #define HAVE_DECL_ISNAN 1 | ||
2177 | 446 | |||
2178 | 447 | /* Define if on AIX 3. | ||
2179 | 448 | System headers sometimes define this. | ||
2180 | 449 | We just want to avoid a redefinition error message. */ | ||
2181 | 450 | #ifndef _ALL_SOURCE | ||
2182 | 451 | /* #undef _ALL_SOURCE */ | ||
2183 | 452 | #endif | ||
2184 | 453 | |||
2185 | 454 | /* Define to empty if the keyword does not work. */ | ||
2186 | 455 | /* #define const */ | ||
2187 | 456 | |||
2188 | 457 | /* Define to 1 if you have the <conio.h> header file. */ | ||
2189 | 458 | #ifndef MS_WINCE | ||
2190 | 459 | #define HAVE_CONIO_H 1 | ||
2191 | 460 | #endif | ||
2192 | 461 | |||
2193 | 462 | /* Define to 1 if you have the <direct.h> header file. */ | ||
2194 | 463 | #ifndef MS_WINCE | ||
2195 | 464 | #define HAVE_DIRECT_H 1 | ||
2196 | 465 | #endif | ||
2197 | 466 | |||
2198 | 467 | /* Define if you have dirent.h. */ | ||
2199 | 468 | /* #define DIRENT 1 */ | ||
2200 | 469 | |||
2201 | 470 | /* Define to the type of elements in the array set by `getgroups'. | ||
2202 | 471 | Usually this is either `int' or `gid_t'. */ | ||
2203 | 472 | /* #undef GETGROUPS_T */ | ||
2204 | 473 | |||
2205 | 474 | /* Define to `int' if <sys/types.h> doesn't define. */ | ||
2206 | 475 | /* #undef gid_t */ | ||
2207 | 476 | |||
2208 | 477 | /* Define if your struct tm has tm_zone. */ | ||
2209 | 478 | /* #undef HAVE_TM_ZONE */ | ||
2210 | 479 | |||
2211 | 480 | /* Define if you don't have tm_zone but do have the external array | ||
2212 | 481 | tzname. */ | ||
2213 | 482 | #define HAVE_TZNAME | ||
2214 | 483 | |||
2215 | 484 | /* Define to `int' if <sys/types.h> doesn't define. */ | ||
2216 | 485 | /* #undef mode_t */ | ||
2217 | 486 | |||
2218 | 487 | /* Define if you don't have dirent.h, but have ndir.h. */ | ||
2219 | 488 | /* #undef NDIR */ | ||
2220 | 489 | |||
2221 | 490 | /* Define to `long' if <sys/types.h> doesn't define. */ | ||
2222 | 491 | /* #undef off_t */ | ||
2223 | 492 | |||
2224 | 493 | /* Define to `int' if <sys/types.h> doesn't define. */ | ||
2225 | 494 | /* #undef pid_t */ | ||
2226 | 495 | |||
2227 | 496 | /* Define if the system does not provide POSIX.1 features except | ||
2228 | 497 | with this defined. */ | ||
2229 | 498 | /* #undef _POSIX_1_SOURCE */ | ||
2230 | 499 | |||
2231 | 500 | /* Define if you need to in order for stat and other things to work. */ | ||
2232 | 501 | /* #undef _POSIX_SOURCE */ | ||
2233 | 502 | |||
2234 | 503 | /* Define as the return type of signal handlers (int or void). */ | ||
2235 | 504 | #define RETSIGTYPE void | ||
2236 | 505 | |||
2237 | 506 | /* Define to `unsigned' if <sys/types.h> doesn't define. */ | ||
2238 | 507 | /* #undef size_t */ | ||
2239 | 508 | |||
2240 | 509 | /* Define if you have the ANSI C header files. */ | ||
2241 | 510 | #define STDC_HEADERS 1 | ||
2242 | 511 | |||
2243 | 512 | /* Define if you don't have dirent.h, but have sys/dir.h. */ | ||
2244 | 513 | /* #undef SYSDIR */ | ||
2245 | 514 | |||
2246 | 515 | /* Define if you don't have dirent.h, but have sys/ndir.h. */ | ||
2247 | 516 | /* #undef SYSNDIR */ | ||
2248 | 517 | |||
2249 | 518 | /* Define if you can safely include both <sys/time.h> and <time.h>. */ | ||
2250 | 519 | /* #undef TIME_WITH_SYS_TIME */ | ||
2251 | 520 | |||
2252 | 521 | /* Define if your <sys/time.h> declares struct tm. */ | ||
2253 | 522 | /* #define TM_IN_SYS_TIME 1 */ | ||
2254 | 523 | |||
2255 | 524 | /* Define to `int' if <sys/types.h> doesn't define. */ | ||
2256 | 525 | /* #undef uid_t */ | ||
2257 | 526 | |||
2258 | 527 | /* Define if the closedir function returns void instead of int. */ | ||
2259 | 528 | /* #undef VOID_CLOSEDIR */ | ||
2260 | 529 | |||
2261 | 530 | /* Define if getpgrp() must be called as getpgrp(0) | ||
2262 | 531 | and (consequently) setpgrp() as setpgrp(0, 0). */ | ||
2263 | 532 | /* #undef GETPGRP_HAVE_ARGS */ | ||
2264 | 533 | |||
2265 | 534 | /* Define this if your time.h defines altzone */ | ||
2266 | 535 | /* #define HAVE_ALTZONE */ | ||
2267 | 536 | |||
2268 | 537 | /* Define if you have the putenv function. */ | ||
2269 | 538 | #ifndef MS_WINCE | ||
2270 | 539 | #define HAVE_PUTENV | ||
2271 | 540 | #endif | ||
2272 | 541 | |||
2273 | 542 | /* Define if your compiler supports function prototypes */ | ||
2274 | 543 | #define HAVE_PROTOTYPES | ||
2275 | 544 | |||
2276 | 545 | /* Define if you can safely include both <sys/select.h> and <sys/time.h> | ||
2277 | 546 | (which you can't on SCO ODT 3.0). */ | ||
2278 | 547 | /* #undef SYS_SELECT_WITH_SYS_TIME */ | ||
2279 | 548 | |||
2280 | 549 | /* Define if you want documentation strings in extension modules */ | ||
2281 | 550 | #define WITH_DOC_STRINGS 1 | ||
2282 | 551 | |||
2283 | 552 | /* Define if you want to compile in rudimentary thread support */ | ||
2284 | 553 | /* #undef WITH_THREAD */ | ||
2285 | 554 | |||
2286 | 555 | /* Define if you want to use the GNU readline library */ | ||
2287 | 556 | /* #define WITH_READLINE 1 */ | ||
2288 | 557 | |||
2289 | 558 | /* Use Python's own small-block memory-allocator. */ | ||
2290 | 559 | #define WITH_PYMALLOC 1 | ||
2291 | 560 | |||
2292 | 561 | /* Define if you have clock. */ | ||
2293 | 562 | /* #define HAVE_CLOCK */ | ||
2294 | 563 | |||
2295 | 564 | /* Define when any dynamic module loading is enabled */ | ||
2296 | 565 | #define HAVE_DYNAMIC_LOADING | ||
2297 | 566 | |||
2298 | 567 | /* Define if you have ftime. */ | ||
2299 | 568 | #ifndef MS_WINCE | ||
2300 | 569 | #define HAVE_FTIME | ||
2301 | 570 | #endif | ||
2302 | 571 | |||
2303 | 572 | /* Define if you have getpeername. */ | ||
2304 | 573 | #define HAVE_GETPEERNAME | ||
2305 | 574 | |||
2306 | 575 | /* Define if you have getpgrp. */ | ||
2307 | 576 | /* #undef HAVE_GETPGRP */ | ||
2308 | 577 | |||
2309 | 578 | /* Define if you have getpid. */ | ||
2310 | 579 | #ifndef MS_WINCE | ||
2311 | 580 | #define HAVE_GETPID | ||
2312 | 581 | #endif | ||
2313 | 582 | |||
2314 | 583 | /* Define if you have gettimeofday. */ | ||
2315 | 584 | /* #undef HAVE_GETTIMEOFDAY */ | ||
2316 | 585 | |||
2317 | 586 | /* Define if you have getwd. */ | ||
2318 | 587 | /* #undef HAVE_GETWD */ | ||
2319 | 588 | |||
2320 | 589 | /* Define if you have lstat. */ | ||
2321 | 590 | /* #undef HAVE_LSTAT */ | ||
2322 | 591 | |||
2323 | 592 | /* Define if you have the mktime function. */ | ||
2324 | 593 | #define HAVE_MKTIME | ||
2325 | 594 | |||
2326 | 595 | /* Define if you have nice. */ | ||
2327 | 596 | /* #undef HAVE_NICE */ | ||
2328 | 597 | |||
2329 | 598 | /* Define if you have readlink. */ | ||
2330 | 599 | /* #undef HAVE_READLINK */ | ||
2331 | 600 | |||
2332 | 601 | /* Define if you have select. */ | ||
2333 | 602 | /* #undef HAVE_SELECT */ | ||
2334 | 603 | |||
2335 | 604 | /* Define if you have setpgid. */ | ||
2336 | 605 | /* #undef HAVE_SETPGID */ | ||
2337 | 606 | |||
2338 | 607 | /* Define if you have setpgrp. */ | ||
2339 | 608 | /* #undef HAVE_SETPGRP */ | ||
2340 | 609 | |||
2341 | 610 | /* Define if you have setsid. */ | ||
2342 | 611 | /* #undef HAVE_SETSID */ | ||
2343 | 612 | |||
2344 | 613 | /* Define if you have setvbuf. */ | ||
2345 | 614 | #define HAVE_SETVBUF | ||
2346 | 615 | |||
2347 | 616 | /* Define if you have siginterrupt. */ | ||
2348 | 617 | /* #undef HAVE_SIGINTERRUPT */ | ||
2349 | 618 | |||
2350 | 619 | /* Define if you have symlink. */ | ||
2351 | 620 | /* #undef HAVE_SYMLINK */ | ||
2352 | 621 | |||
2353 | 622 | /* Define if you have tcgetpgrp. */ | ||
2354 | 623 | /* #undef HAVE_TCGETPGRP */ | ||
2355 | 624 | |||
2356 | 625 | /* Define if you have tcsetpgrp. */ | ||
2357 | 626 | /* #undef HAVE_TCSETPGRP */ | ||
2358 | 627 | |||
2359 | 628 | /* Define if you have times. */ | ||
2360 | 629 | /* #undef HAVE_TIMES */ | ||
2361 | 630 | |||
2362 | 631 | /* Define if you have uname. */ | ||
2363 | 632 | /* #undef HAVE_UNAME */ | ||
2364 | 633 | |||
2365 | 634 | /* Define if you have waitpid. */ | ||
2366 | 635 | /* #undef HAVE_WAITPID */ | ||
2367 | 636 | |||
2368 | 637 | /* Define to 1 if you have the `wcsftime' function. */ | ||
2369 | 638 | #if defined(_MSC_VER) && _MSC_VER >= 1310 | ||
2370 | 639 | #define HAVE_WCSFTIME 1 | ||
2371 | 640 | #endif | ||
2372 | 641 | |||
2373 | 642 | /* Define to 1 if you have the `wcscoll' function. */ | ||
2374 | 643 | #ifndef MS_WINCE | ||
2375 | 644 | #define HAVE_WCSCOLL 1 | ||
2376 | 645 | #endif | ||
2377 | 646 | |||
2378 | 647 | /* Define to 1 if you have the `wcsxfrm' function. */ | ||
2379 | 648 | #ifndef MS_WINCE | ||
2380 | 649 | #define HAVE_WCSXFRM 1 | ||
2381 | 650 | #endif | ||
2382 | 651 | |||
2383 | 652 | /* Define if the zlib library has inflateCopy */ | ||
2384 | 653 | #define HAVE_ZLIB_COPY 1 | ||
2385 | 654 | |||
2386 | 655 | /* Define if you have the <dlfcn.h> header file. */ | ||
2387 | 656 | /* #undef HAVE_DLFCN_H */ | ||
2388 | 657 | |||
2389 | 658 | /* Define to 1 if you have the <errno.h> header file. */ | ||
2390 | 659 | #ifndef MS_WINCE | ||
2391 | 660 | #define HAVE_ERRNO_H 1 | ||
2392 | 661 | #endif | ||
2393 | 662 | |||
2394 | 663 | /* Define if you have the <fcntl.h> header file. */ | ||
2395 | 664 | #ifndef MS_WINCE | ||
2396 | 665 | #define HAVE_FCNTL_H 1 | ||
2397 | 666 | #endif | ||
2398 | 667 | |||
2399 | 668 | /* Define to 1 if you have the <process.h> header file. */ | ||
2400 | 669 | #ifndef MS_WINCE | ||
2401 | 670 | #define HAVE_PROCESS_H 1 | ||
2402 | 671 | #endif | ||
2403 | 672 | |||
2404 | 673 | /* Define to 1 if you have the <signal.h> header file. */ | ||
2405 | 674 | #ifndef MS_WINCE | ||
2406 | 675 | #define HAVE_SIGNAL_H 1 | ||
2407 | 676 | #endif | ||
2408 | 677 | |||
2409 | 678 | /* Define if you have the <stdarg.h> prototypes. */ | ||
2410 | 679 | #define HAVE_STDARG_PROTOTYPES | ||
2411 | 680 | |||
2412 | 681 | /* Define if you have the <stddef.h> header file. */ | ||
2413 | 682 | #define HAVE_STDDEF_H 1 | ||
2414 | 683 | |||
2415 | 684 | /* Define if you have the <sys/audioio.h> header file. */ | ||
2416 | 685 | /* #undef HAVE_SYS_AUDIOIO_H */ | ||
2417 | 686 | |||
2418 | 687 | /* Define if you have the <sys/param.h> header file. */ | ||
2419 | 688 | /* #define HAVE_SYS_PARAM_H 1 */ | ||
2420 | 689 | |||
2421 | 690 | /* Define if you have the <sys/select.h> header file. */ | ||
2422 | 691 | /* #define HAVE_SYS_SELECT_H 1 */ | ||
2423 | 692 | |||
2424 | 693 | /* Define to 1 if you have the <sys/stat.h> header file. */ | ||
2425 | 694 | #ifndef MS_WINCE | ||
2426 | 695 | #define HAVE_SYS_STAT_H 1 | ||
2427 | 696 | #endif | ||
2428 | 697 | |||
2429 | 698 | /* Define if you have the <sys/time.h> header file. */ | ||
2430 | 699 | /* #define HAVE_SYS_TIME_H 1 */ | ||
2431 | 700 | |||
2432 | 701 | /* Define if you have the <sys/times.h> header file. */ | ||
2433 | 702 | /* #define HAVE_SYS_TIMES_H 1 */ | ||
2434 | 703 | |||
2435 | 704 | /* Define to 1 if you have the <sys/types.h> header file. */ | ||
2436 | 705 | #ifndef MS_WINCE | ||
2437 | 706 | #define HAVE_SYS_TYPES_H 1 | ||
2438 | 707 | #endif | ||
2439 | 708 | |||
2440 | 709 | /* Define if you have the <sys/un.h> header file. */ | ||
2441 | 710 | /* #define HAVE_SYS_UN_H 1 */ | ||
2442 | 711 | |||
2443 | 712 | /* Define if you have the <sys/utime.h> header file. */ | ||
2444 | 713 | /* #define HAVE_SYS_UTIME_H 1 */ | ||
2445 | 714 | |||
2446 | 715 | /* Define if you have the <sys/utsname.h> header file. */ | ||
2447 | 716 | /* #define HAVE_SYS_UTSNAME_H 1 */ | ||
2448 | 717 | |||
2449 | 718 | /* Define if you have the <unistd.h> header file. */ | ||
2450 | 719 | /* #define HAVE_UNISTD_H 1 */ | ||
2451 | 720 | |||
2452 | 721 | /* Define if you have the <utime.h> header file. */ | ||
2453 | 722 | /* #define HAVE_UTIME_H 1 */ | ||
2454 | 723 | |||
2455 | 724 | /* Define if the compiler provides a wchar.h header file. */ | ||
2456 | 725 | #define HAVE_WCHAR_H 1 | ||
2457 | 726 | |||
2458 | 727 | /* The size of `wchar_t', as computed by sizeof. */ | ||
2459 | 728 | #define SIZEOF_WCHAR_T 2 | ||
2460 | 729 | |||
2461 | 730 | /* Define if you have the dl library (-ldl). */ | ||
2462 | 731 | /* #undef HAVE_LIBDL */ | ||
2463 | 732 | |||
2464 | 733 | /* Define if you have the mpc library (-lmpc). */ | ||
2465 | 734 | /* #undef HAVE_LIBMPC */ | ||
2466 | 735 | |||
2467 | 736 | /* Define if you have the nsl library (-lnsl). */ | ||
2468 | 737 | #define HAVE_LIBNSL 1 | ||
2469 | 738 | |||
2470 | 739 | /* Define if you have the seq library (-lseq). */ | ||
2471 | 740 | /* #undef HAVE_LIBSEQ */ | ||
2472 | 741 | |||
2473 | 742 | /* Define if you have the socket library (-lsocket). */ | ||
2474 | 743 | #define HAVE_LIBSOCKET 1 | ||
2475 | 744 | |||
2476 | 745 | /* Define if you have the sun library (-lsun). */ | ||
2477 | 746 | /* #undef HAVE_LIBSUN */ | ||
2478 | 747 | |||
2479 | 748 | /* Define if you have the termcap library (-ltermcap). */ | ||
2480 | 749 | /* #undef HAVE_LIBTERMCAP */ | ||
2481 | 750 | |||
2482 | 751 | /* Define if you have the termlib library (-ltermlib). */ | ||
2483 | 752 | /* #undef HAVE_LIBTERMLIB */ | ||
2484 | 753 | |||
2485 | 754 | /* Define if you have the thread library (-lthread). */ | ||
2486 | 755 | /* #undef HAVE_LIBTHREAD */ | ||
2487 | 756 | |||
2488 | 757 | /* WinSock does not use a bitmask in select, and uses | ||
2489 | 758 | socket handles greater than FD_SETSIZE */ | ||
2490 | 759 | #define Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE | ||
2491 | 760 | |||
2492 | 761 | /* Define if C doubles are 64-bit IEEE 754 binary format, stored with the | ||
2493 | 762 | least significant byte first */ | ||
2494 | 763 | #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1 | ||
2495 | 764 | |||
2496 | 765 | #endif /* !Py_CONFIG_H */ | ||
2497 | 766 | 0 | ||
2498 | === removed file 'win_fix/readme.txt' | |||
2499 | --- win_fix/readme.txt 2014-01-20 14:29:21 +0000 | |||
2500 | +++ win_fix/readme.txt 1970-01-01 00:00:00 +0000 | |||
2501 | @@ -1,6 +0,0 @@ | |||
2502 | 1 | The Python distro does not come packaged with the debug | ||
2503 | 2 | library: "pythonXX_d.lib". So, in order to get ECS:Python | ||
2504 | 3 | to compile in Debug mode: | ||
2505 | 4 | |||
2506 | 5 | copy: "DEBUG Fix\PythonXX\pyconfig.h" | ||
2507 | 6 | to: "PYTHON_ROOT\include\" | ||
2508 | 7 | \ No newline at end of file | 0 | \ No newline at end of file |