Merge lp:~marcustomlinson/ecspython/fix_float_params into lp:ecspython

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
Reviewer Review Type Date Requested Status
Marcus Tomlinson Pending
Review via email: mp+243568@code.launchpad.net
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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-01-26 11:00:54 +0000
+++ CMakeLists.txt 2014-12-05 19:42:33 +0000
@@ -1,11 +1,9 @@
1cmake_minimum_required(VERSION 2.8)1cmake_minimum_required(VERSION 2.8)
22
3set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -Wall -Wextra")
4
3project(EcsPython)5project(EcsPython)
46
5add_definitions(
6 -fpermissive
7)
8
9add_subdirectory(example)7add_subdirectory(example)
108
11if(UNIX)9if(UNIX)
@@ -13,7 +11,6 @@
13endif(UNIX)11endif(UNIX)
1412
15if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") 13if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
16 add_definitions(-DECS_EXPORT)
17 set(PYTHON_LIBRARIES "C:/Python27/libs/python27.lib")14 set(PYTHON_LIBRARIES "C:/Python27/libs/python27.lib")
18 set(PYTHON_INCLUDE_DIRS "C:/Python27/include")15 set(PYTHON_INCLUDE_DIRS "C:/Python27/include")
19endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")16endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
2017
=== modified file 'example/main.cpp'
--- example/main.cpp 2014-01-25 13:13:29 +0000
+++ example/main.cpp 2014-12-05 19:42:33 +0000
@@ -1,6 +1,6 @@
1/************************************************************************1/************************************************************************
2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++
3Copyright (c) 2012-2013 Marcus Tomlinson3Copyright (c) 2012-2014 Marcus Tomlinson
44
5This file is part of EcsPython.5This file is part of EcsPython.
66
@@ -50,11 +50,17 @@
50 return true;50 return true;
51 }51 }
5252
53 void ShowLots( unsigned long count, std::string message )53 float ShowDouble( double message )
54 {
55 std::cout << message;
56 return (float)message;
57 }
58
59 void ShowLots( unsigned long count, char* message )
54 {60 {
55 for( unsigned int i = 0; i < count; i++ )61 for( unsigned int i = 0; i < count; i++ )
56 {62 {
57 std::cout << message.c_str();63 std::cout << message;
58 }64 }
59 lastMessage = message;65 lastMessage = message;
60 }66 }
@@ -64,16 +70,43 @@
64 return lastMessage;70 return lastMessage;
65 }71 }
6672
73 void ShowPtr( void* thiz )
74 {
75 ((Simple*)thiz)->Show("Hey! This is coming from a pointer :)");
76 }
77
67private:78private:
68 std::string lastMessage;79 std::string lastMessage;
69};80};
7081
82// Simple Class Factory
83// ====================
84class SimpleFactory
85{
86public:
87 void* NewSimple( std::string firstMessage )
88 {
89 return new Simple( firstMessage );
90 }
91
92 void DeleteSimple( void* simple )
93 {
94 delete ( ( Simple* )simple );
95 }
96};
97
71// Register Classes + Methods98// Register Classes + Methods
72// ==========================99// ==========================
73ECS_REGISTER_CLASS( Simple );100ECS_REGISTER_CLASS( Simple )
74ECS_REGISTER_METHOD_RETURN( Simple, Show, bool, std::string );101ECS_REGISTER_METHOD_RETURN( Simple, Show, bool, std::string )
75ECS_REGISTER_METHOD_VOID( Simple, ShowLots, unsigned long, std::string );102ECS_REGISTER_METHOD_RETURN( Simple, ShowDouble, float, double )
76ECS_REGISTER_METHOD_RETURN( Simple, GetLastMessage, std::string );103ECS_REGISTER_METHOD_VOID( Simple, ShowLots, unsigned long, char* )
104ECS_REGISTER_METHOD_RETURN( Simple, GetLastMessage, std::string )
105ECS_REGISTER_METHOD_VOID( Simple, ShowPtr, void* )
106
107ECS_REGISTER_CLASS( SimpleFactory )
108ECS_REGISTER_METHOD_RETURN( SimpleFactory, NewSimple, void*, std::string )
109ECS_REGISTER_METHOD_VOID( SimpleFactory, DeleteSimple, void* )
77110
78//=================================================================================================111//=================================================================================================
79112
@@ -85,42 +118,66 @@
85 // ======================118 // ======================
86 Ecs_Init_Simple();119 Ecs_Init_Simple();
87 Ecs_Init_Simple_Show();120 Ecs_Init_Simple_Show();
121 Ecs_Init_Simple_ShowDouble();
88 Ecs_Init_Simple_ShowLots();122 Ecs_Init_Simple_ShowLots();
89 Ecs_Init_Simple_GetLastMessage();123 Ecs_Init_Simple_GetLastMessage();
124 Ecs_Init_Simple_ShowPtr();
125
126 Ecs_Init_SimpleFactory();
127 Ecs_Init_SimpleFactory_NewSimple();
128 Ecs_Init_SimpleFactory_DeleteSimple();
90129
91 // Initialize EcsPython130 // Initialize EcsPython
92 // ====================131 // ====================
93 Ecs_Initialize();132 Ecs_Initialize();
94133
95 // Create New Class Instance
96 // =========================
97 Simple* newSimple = new Simple( "(first message)" );
98134
99 // Expose Class Instance To Python135 // Create And Expose Class Instance To Python
100 // ===============================136 // ==========================================
101 Ecs_Expose_Object( newSimple, "newSimple" );137 Simple newSimple( "(first message)" );
138 Ecs_Expose_Object( &newSimple, "newSimple" );
102139
103 // Use Exposed Class Instance From Python140 // Use Exposed Class Instance From Python
104 // ======================================141 // ======================================
105 Ecs_Python_Cmd( "print( newSimple.GetLastMessage() )" );142 Ecs_Python_Cmd( "print( newSimple.GetLastMessage() )" );
106143
144 Ecs_Python_Cmd( "newSimple.Show( 'my favorite number is ' )" );
145 Ecs_Python_Cmd( "newSimple.ShowDouble( 5.9982 )" );
146 Ecs_Python_Cmd( "print('')" );
147
148 Ecs_Python_Cmd( "newSimple.ShowPtr( newSimple() )" );
149 Ecs_Python_Cmd( "print('')" );
150
107 Ecs_Python_Cmd( "state = newSimple.Show( 'hello' )" );151 Ecs_Python_Cmd( "state = newSimple.Show( 'hello' )" );
108 Ecs_Python_Cmd( "if state == True: \n\t print( ' there,' )" );152 Ecs_Python_Cmd( "if state == True:\n\tprint( ' there,' )" );
109153
110 Ecs_Python_Cmd( "newSimple.ShowLots( 5, 'again and ' )" );154 Ecs_Python_Cmd( "newSimple.ShowLots( 5, 'again and ' )" );
111155
112 Ecs_Python_Cmd( "newSimple.Show( 'once more.' )" );156 Ecs_Python_Cmd( "newSimple.Show( 'once more.' )" );
113 Ecs_Python_Cmd( "print('')" );157 Ecs_Python_Cmd( "print('')" );
114158
115 // Use Class Instance From C++159 // Use The Class Instance From C++
116 // ===========================160 // ===============================
117 std::cout << newSimple->GetLastMessage().c_str();161 std::cout << "Ok, " << newSimple.GetLastMessage().c_str() << std::endl;
118 getchar();162
163
164 // Create And Expose Factory To Python
165 // ===================================
166 SimpleFactory simpleFactory;
167 Ecs_Expose_Object( &simpleFactory, "simpleFactory" );
168
169 // Create A New Class Instance From Python
170 // =======================================
171 Ecs_Python_Cmd( "anotherSimple = Simple( simpleFactory.NewSimple( '\\'Allo ' ) )" );
172 Ecs_Python_Cmd( "print( anotherSimple.GetLastMessage() + '\\'Allo!')" );
173 Ecs_Python_Cmd( "simpleFactory.DeleteSimple( anotherSimple() )" );
174
119175
120 // Finalize EcsPython176 // Finalize EcsPython
121 // ==================177 // ==================
122 Ecs_Finalize();178 Ecs_Finalize();
123179
180 getchar();
124 return 0;181 return 0;
125}182}
126183
127184
=== modified file 'include/EcsPython.h'
--- include/EcsPython.h 2014-01-25 13:13:29 +0000
+++ include/EcsPython.h 2014-12-05 19:42:33 +0000
@@ -1,6 +1,6 @@
1/************************************************************************1/************************************************************************
2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++
3Copyright (c) 2012-2013 Marcus Tomlinson3Copyright (c) 2012-2014 Marcus Tomlinson
44
5This file is part of EcsPython.5This file is part of EcsPython.
66
@@ -32,22 +32,8 @@
32#ifndef ECSPYTHON_H32#ifndef ECSPYTHON_H
33#define ECSPYTHON_H33#define ECSPYTHON_H
3434
35#ifdef _WIN3235#include <dspatch/DspThread.h>
36
37#ifdef ECS_EXPORT
38 #define DLLPORT __declspec(dllexport)
39#else
40 #define DLLPORT __declspec(dllimport)
41#endif
42
43#else
44
45#define DLLPORT
46
47#endif
48
49#include <ecspython/EcsMacros.h>36#include <ecspython/EcsMacros.h>
50#include <dspatch/DspThread.h>
5137
52struct PyMethodDef;38struct PyMethodDef;
5339
@@ -55,7 +41,7 @@
55// EcsPython Globals41// EcsPython Globals
56// =================42// =================
5743
58struct DLLEXPORT EcsClass44struct EcsClass
59{45{
60 EcsClass( std::string newPyClassName, const std::type_info& newPyClassType )46 EcsClass( std::string newPyClassName, const std::type_info& newPyClassType )
61 : pyClassName( newPyClassName ),47 : pyClassName( newPyClassName ),
@@ -65,7 +51,7 @@
65 const std::type_info& pyClassType;51 const std::type_info& pyClassType;
66};52};
6753
68struct DLLEXPORT EcsObject54struct EcsObject
69{55{
70 EcsObject( char* newPyObject, std::string newPyClassName, std::string newPyObjectName )56 EcsObject( char* newPyObject, std::string newPyClassName, std::string newPyObjectName )
71 : pyObject( newPyObject ),57 : pyObject( newPyObject ),
@@ -77,54 +63,54 @@
77 std::string pyObjectName;63 std::string pyObjectName;
78};64};
7965
80DLLPORT extern DspMutex EcsPythonCmdMutex; // Mutex for thread-safe python calls66extern DspMutex EcsPythonCmdMutex; // Mutex for thread-safe python calls
81DLLPORT extern std::vector< EcsClass* > EcsPythonClassesDict; // C++ class dictionary67extern std::vector< EcsClass* > EcsPythonClassesDict; // C++ class dictionary
82DLLPORT extern std::string EcsPythonClassesDef; // Python definition string for C++ classes 68extern std::string EcsPythonClassesDef; // Python definition string for C++ classes
83DLLPORT extern std::vector< PyMethodDef > EcsPythonMethods; // Methods for EcsPython python module69extern std::vector< PyMethodDef > EcsPythonMethods; // Methods for EcsPython python module
84DLLPORT extern std::vector< EcsObject* > EcsExposedObjects; // C++ objects exposed to Python70extern std::vector< EcsObject* > EcsExposedObjects; // C++ objects exposed to Python
8571
86#if PY_MAJOR_VERSION >= 372#if PY_MAJOR_VERSION >= 3
87DLLPORT extern struct PyModuleDef EcsPythonModule; // EcsPython python module73extern struct PyModuleDef EcsPythonModule; // EcsPython python module
88#endif74#endif
8975
90//=================================================================================================76//=================================================================================================
91// Initialize EcsPython77// Initialize EcsPython
92// ====================78// ====================
9379
94DLLEXPORT void Ecs_Initialize();80void Ecs_Initialize();
9581
96//-------------------------------------------------------------------------------------------------82//-------------------------------------------------------------------------------------------------
97// Finalize EcsPython83// Finalize EcsPython
98// ==================84// ==================
9985
100DLLEXPORT void Ecs_Finalize();86void Ecs_Finalize();
10187
102//-------------------------------------------------------------------------------------------------88//-------------------------------------------------------------------------------------------------
103// Execute Python Command89// Execute Python Command
104// ======================90// ======================
10591
106DLLEXPORT void Ecs_Python_Cmd( std::string pythonCmdString );92void Ecs_Python_Cmd( std::string pythonCmdString );
10793
108//-------------------------------------------------------------------------------------------------94//-------------------------------------------------------------------------------------------------
109// Execute Python File95// Execute Python File
110// ===================96// ===================
11197
112DLLEXPORT void Ecs_Python_File( std::string pythonScriptPath );98void Ecs_Python_File( std::string pythonScriptPath );
11399
114//-------------------------------------------------------------------------------------------------100//-------------------------------------------------------------------------------------------------
115// Get Object Value From Python101// Get Object Value From Python
116// ============================102// ============================
117103
118DLLEXPORT std::string Ecs_Get_Value( std::string pyObjectName );104std::string Ecs_Get_Value( std::string pyObjectName );
119105
120//-------------------------------------------------------------------------------------------------106//-------------------------------------------------------------------------------------------------
121// Expose Class Instance To Python107// Expose Class Instance To Python
122// ===============================108// ===============================
123109
124DLLEXPORT void _Ecs_Expose_Object( char* pyObject, std::string pyClassName, std::string pyObjectName );110void _Ecs_Expose_Object( char* pyObject, std::string pyClassName, std::string pyObjectName );
125111
126template< class ObjectType >112template< class ObjectType >
127DLLEXPORT void Ecs_Expose_Object( ObjectType* object, std::string pyObjectName )113void Ecs_Expose_Object( ObjectType* object, std::string pyObjectName )
128{114{
129 for( unsigned long i = 0; i < EcsPythonClassesDict.size(); i++ )115 for( unsigned long i = 0; i < EcsPythonClassesDict.size(); i++ )
130 {116 {
131117
=== modified file 'include/dspatch/DspThread.h'
--- include/dspatch/DspThread.h 2014-01-25 10:46:21 +0000
+++ include/dspatch/DspThread.h 2014-12-05 19:42:33 +0000
@@ -1,6 +1,6 @@
1/************************************************************************1/************************************************************************
2DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library2DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library
3Copyright (c) 2012-2013 Marcus Tomlinson3Copyright (c) 2012-2014 Marcus Tomlinson
44
5This file is part of DSPatch.5This file is part of DSPatch.
66
77
=== modified file 'include/dspatch/DspThreadNull.h'
--- include/dspatch/DspThreadNull.h 2014-01-25 10:46:21 +0000
+++ include/dspatch/DspThreadNull.h 2014-12-05 19:42:33 +0000
@@ -1,6 +1,6 @@
1/************************************************************************1/************************************************************************
2DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library2DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library
3Copyright (c) 2012-2013 Marcus Tomlinson3Copyright (c) 2012-2014 Marcus Tomlinson
44
5This file is part of DSPatch.5This file is part of DSPatch.
66
@@ -55,7 +55,7 @@
55 HighPriority,55 HighPriority,
56 HighestPriority,56 HighestPriority,
5757
58 TimeCriticalPriority,58 TimeCriticalPriority
59 };59 };
6060
61 virtual void Start( Priority priority ) {}61 virtual void Start( Priority priority ) {}
6262
=== modified file 'include/dspatch/DspThreadUnix.h'
--- include/dspatch/DspThreadUnix.h 2014-01-25 10:46:21 +0000
+++ include/dspatch/DspThreadUnix.h 2014-12-05 19:42:33 +0000
@@ -1,6 +1,6 @@
1/************************************************************************1/************************************************************************
2DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library2DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library
3Copyright (c) 2012-2013 Marcus Tomlinson3Copyright (c) 2012-2014 Marcus Tomlinson
44
5This file is part of DSPatch.5This file is part of DSPatch.
66
@@ -35,7 +35,8 @@
35class DspThread35class DspThread
36{36{
37public:37public:
38 DspThread() {}38 DspThread()
39 : _threadAttatched( false ) {}
3940
40 virtual ~DspThread()41 virtual ~DspThread()
41 {42 {
@@ -52,19 +53,24 @@
52 HighPriority,53 HighPriority,
53 HighestPriority,54 HighestPriority,
5455
55 TimeCriticalPriority,56 TimeCriticalPriority
56 };57 };
5758
58 virtual void Start( Priority priority = NormalPriority )59 virtual void Start( Priority priority = NormalPriority )
59 {60 {
60 pthread_create( &_thread, NULL, _ThreadFunc, this );61 pthread_create( &_thread, NULL, _ThreadFunc, this );
62 _threadAttatched = true;
6163
62 _SetPriority( _thread, priority );64 _SetPriority( _thread, priority );
63 }65 }
6466
65 virtual void Stop()67 virtual void Stop()
66 {68 {
67 pthread_detach( _thread );69 if( _threadAttatched )
70 {
71 pthread_detach( _thread );
72 _threadAttatched = false;
73 }
68 }74 }
6975
70 static void SetPriority( Priority priority )76 static void SetPriority( Priority priority )
@@ -78,8 +84,6 @@
78 }84 }
7985
80private:86private:
81 pthread_t _thread;
82
83 static void* _ThreadFunc( void* pv )87 static void* _ThreadFunc( void* pv )
84 {88 {
85 ( reinterpret_cast<DspThread*>( pv ) )->_Run();89 ( reinterpret_cast<DspThread*>( pv ) )->_Run();
@@ -100,14 +104,16 @@
100104
101 pthread_setschedparam( threadID, policy, &param );105 pthread_setschedparam( threadID, policy, &param );
102 }106 }
107
108private:
109 pthread_t _thread;
110 bool _threadAttatched;
103};111};
104112
105//=================================================================================================113//=================================================================================================
106114
107class DspMutex115class DspMutex
108{116{
109 friend class DspWaitCondition;
110
111public:117public:
112 DspMutex()118 DspMutex()
113 {119 {
@@ -130,6 +136,8 @@
130 }136 }
131137
132private:138private:
139 friend class DspWaitCondition;
140
133 pthread_mutex_t _mutex;141 pthread_mutex_t _mutex;
134};142};
135143
136144
=== modified file 'include/dspatch/DspThreadWin.h'
--- include/dspatch/DspThreadWin.h 2014-01-25 10:46:21 +0000
+++ include/dspatch/DspThreadWin.h 2014-12-05 19:42:33 +0000
@@ -1,6 +1,6 @@
1/************************************************************************1/************************************************************************
2DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library2DSPatch - Cross-Platform, Object-Oriented, Flow-Based Programming Library
3Copyright (c) 2012-2013 Marcus Tomlinson3Copyright (c) 2012-2014 Marcus Tomlinson
44
5This file is part of DSPatch.5This file is part of DSPatch.
66
@@ -35,10 +35,10 @@
35{35{
36public:36public:
37 DspThread()37 DspThread()
38 : _threadHandle( NULL ) {}38 : _threadHandle( NULL ) {}
3939
40 DspThread( const DspThread& )40 DspThread( DspThread const& )
41 : _threadHandle( NULL ) {}41 : _threadHandle( NULL ) {}
4242
43 virtual ~DspThread()43 virtual ~DspThread()
44 {44 {
@@ -55,7 +55,7 @@
55 HighPriority = 1,55 HighPriority = 1,
56 HighestPriority = 2,56 HighestPriority = 2,
5757
58 TimeCriticalPriority = 15,58 TimeCriticalPriority = 15
59 };59 };
6060
61 virtual void Start( Priority priority = NormalPriority )61 virtual void Start( Priority priority = NormalPriority )
@@ -91,6 +91,7 @@
9191
92 virtual void _Run() = 0;92 virtual void _Run() = 0;
9393
94private:
94 HANDLE _threadHandle;95 HANDLE _threadHandle;
95};96};
9697
@@ -104,7 +105,7 @@
104 InitializeCriticalSection( &_cs );105 InitializeCriticalSection( &_cs );
105 }106 }
106107
107 DspMutex( const DspMutex& )108 DspMutex( DspMutex const& )
108 {109 {
109 InitializeCriticalSection( &_cs );110 InitializeCriticalSection( &_cs );
110 }111 }
@@ -138,7 +139,7 @@
138 _hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );139 _hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
139 }140 }
140141
141 DspWaitCondition( const DspWaitCondition& )142 DspWaitCondition( DspWaitCondition const& )
142 {143 {
143 _hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );144 _hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
144 }145 }
145146
=== modified file 'include/ecspython/EcsMacros.h'
--- include/ecspython/EcsMacros.h 2014-01-26 12:29:03 +0000
+++ include/ecspython/EcsMacros.h 2014-12-05 19:42:33 +0000
@@ -1,6 +1,6 @@
1/************************************************************************1/************************************************************************
2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++
3Copyright (c) 2012-2013 Marcus Tomlinson3Copyright (c) 2012-2014 Marcus Tomlinson
44
5This file is part of EcsPython.5This file is part of EcsPython.
66
@@ -36,27 +36,25 @@
36#include <typeinfo>36#include <typeinfo>
37#include <string>37#include <string>
3838
39#include <dspatch/DspThread.h>
40
41//=================================================================================================39//=================================================================================================
4240
43typedef struct _object PyObject;41typedef struct _object PyObject;
44typedef PyObject* (*PyCFunction)( PyObject *, PyObject * );42typedef PyObject* (*PyCFunction)( PyObject *, PyObject * );
4543
46DLLPORT extern int (*_Ecs_ParseTuple)( PyObject *, const char *, ... );44extern int (*_Ecs_ParseTuple)( PyObject *, const char *, ... );
4745
48//=================================================================================================46//=================================================================================================
4947
50DLLEXPORT void _EcsAddNewMethod( const char *methodName, PyCFunction methodPointer, int methodFlags );48void _EcsAddNewMethod( const char *methodName, PyCFunction methodPointer, int methodFlags );
5149
52//-------------------------------------------------------------------------------------------------50//-------------------------------------------------------------------------------------------------
5351
54template< class Type >52template< class Type >
55DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const Type& Value );53PyObject* _Ecs_ToPyObject( const Type& Value );
5654
57//-------------------------------------------------------------------------------------------------55//-------------------------------------------------------------------------------------------------
5856
59DLLEXPORT PyObject* _Ecs_GetPythonNull();57PyObject* _Ecs_GetPythonNull();
6058
61//=================================================================================================59//=================================================================================================
62// COMMON TOOLS60// COMMON TOOLS
@@ -94,15 +92,35 @@
94 else if( typeid( Type ) == typeid( bool ) )92 else if( typeid( Type ) == typeid( bool ) )
95 append = "i";93 append = "i";
96 else if( typeid( Type ) == typeid( double ) )94 else if( typeid( Type ) == typeid( double ) )
97 append = "d";95 append = "f";
98 else if( typeid( Type ) == typeid( float ) )96 else if( typeid( Type ) == typeid( float ) )
99 append = "f";97 append = "f";
98 else if( typeid( Type ) == typeid( void* ) )
99 append = "k";
100100
101 pyTypes.append( append );101 pyTypes.append( append );
102}102}
103103
104//-------------------------------------------------------------------------------------------------104//-------------------------------------------------------------------------------------------------
105105
106template< class Type >
107void _Ecs_FromPyObject( char* in, Type& out )
108{
109 out = (Type)in;
110}
111
112inline void _Ecs_FromPyObject( char* in, double& out )
113{
114 out = *(float*)&in;
115}
116
117inline void _Ecs_FromPyObject( char* in, float& out )
118{
119 out = *(float*)&in;
120}
121
122//-------------------------------------------------------------------------------------------------
123
106template< class RetT >124template< class RetT >
107static std::string _Ecs_MakeMethodArgs()125static std::string _Ecs_MakeMethodArgs()
108{126{
@@ -167,11 +185,11 @@
167static void Ecs_Init##_##Class()\185static void Ecs_Init##_##Class()\
168{\186{\
169 EcsPythonClassesDict.push_back( new EcsClass( #Class, typeid( Class ) ) );\187 EcsPythonClassesDict.push_back( new EcsClass( #Class, typeid( Class ) ) );\
170 EcsPythonClassesDef.append("class " #Class ": \n\188 EcsPythonClassesDef.append("class " #Class ":\n\
171\t def SetEcsPtr( self, i ): \n\189\tdef __init__( self, ecsPtr ):\n\
172\t\t self._self = i \n\190\t\tself._self = ecsPtr\n\
173\t def GetEcsPtr( self ): \n\191\tdef __call__( self ):\n\
174\t\t return self._self \n");\192\t\treturn self._self\n");\
175}193}
176194
177//=================================================================================================195//=================================================================================================
@@ -183,8 +201,8 @@
183{\201{\
184 std::string methodArgs = _Ecs_MakeMethodArgs< __VA_ARGS__ >();\202 std::string methodArgs = _Ecs_MakeMethodArgs< __VA_ARGS__ >();\
185 _EcsAddNewMethod( #Class "_" #Method, Class##_##Method, 0x0001 );\203 _EcsAddNewMethod( #Class "_" #Method, Class##_##Method, 0x0001 );\
186 EcsPythonClassesDef.append( "\t def " #Method "( self").append(methodArgs).append(" ): \n\204 EcsPythonClassesDef.append( "\tdef " #Method "( self").append(methodArgs).append(" ):\n\
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" );\
188}206}
189207
190//-------------------------------------------------------------------------------------------------208//-------------------------------------------------------------------------------------------------
@@ -204,7 +222,10 @@
204 success = true; char* objs[2]; std::string pyTypes = "k";\222 success = true; char* objs[2]; std::string pyTypes = "k";\
205 _Ecs_AppendPythonArgType<A1T>( pyTypes );\223 _Ecs_AppendPythonArgType<A1T>( pyTypes );\
206 if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1] ) )\224 if( _Ecs_ParseTuple( args, pyTypes.c_str(), &objs[0], &objs[1] ) )\
207 return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1] );\225 {\
226 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
227 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1 );\
228 }\
208 success = false; return RetT();\229 success = false; return RetT();\
209}\230}\
210template< class ObjT, class RetT, class A1T, class A2T >\231template< class ObjT, class RetT, class A1T, class A2T >\
@@ -214,7 +235,11 @@
214 _Ecs_AppendPythonArgType<A1T>( pyTypes );\235 _Ecs_AppendPythonArgType<A1T>( pyTypes );\
215 _Ecs_AppendPythonArgType<A2T>( pyTypes );\236 _Ecs_AppendPythonArgType<A2T>( pyTypes );\
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] ) )\
217 return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2] );\238 {\
239 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
240 A2T a2; _Ecs_FromPyObject(objs[2], a2);\
241 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2 );\
242 }\
218 success = false; return RetT();\243 success = false; return RetT();\
219}\244}\
220template< class ObjT, class RetT, class A1T, class A2T, class A3T >\245template< class ObjT, class RetT, class A1T, class A2T, class A3T >\
@@ -225,7 +250,12 @@
225 _Ecs_AppendPythonArgType<A2T>( pyTypes );\250 _Ecs_AppendPythonArgType<A2T>( pyTypes );\
226 _Ecs_AppendPythonArgType<A3T>( pyTypes );\251 _Ecs_AppendPythonArgType<A3T>( pyTypes );\
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] ) )\
228 return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3] );\253 {\
254 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
255 A2T a2; _Ecs_FromPyObject(objs[2], a2);\
256 A3T a3; _Ecs_FromPyObject(objs[3], a3);\
257 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3 );\
258 }\
229 success = false; return RetT();\259 success = false; return RetT();\
230}\260}\
231template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T >\261template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T >\
@@ -237,7 +267,13 @@
237 _Ecs_AppendPythonArgType<A3T>( pyTypes );\267 _Ecs_AppendPythonArgType<A3T>( pyTypes );\
238 _Ecs_AppendPythonArgType<A4T>( pyTypes );\268 _Ecs_AppendPythonArgType<A4T>( pyTypes );\
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] ) )\
240 return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3], (A4T)objs[4] );\270 {\
271 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
272 A2T a2; _Ecs_FromPyObject(objs[2], a2);\
273 A3T a3; _Ecs_FromPyObject(objs[3], a3);\
274 A4T a4; _Ecs_FromPyObject(objs[4], a4);\
275 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4 );\
276 }\
241 success = false; return RetT();\277 success = false; return RetT();\
242}\278}\
243template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T >\279template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T >\
@@ -250,7 +286,14 @@
250 _Ecs_AppendPythonArgType<A4T>( pyTypes );\286 _Ecs_AppendPythonArgType<A4T>( pyTypes );\
251 _Ecs_AppendPythonArgType<A5T>( pyTypes );\287 _Ecs_AppendPythonArgType<A5T>( pyTypes );\
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] ) )\
253 return ( RetT )( ( ObjT* ) objs[0] )->Method( (A1T)objs[1], (A2T)objs[2], (A3T)objs[3], (A4T)objs[4], (A5T)objs[5] );\289 {\
290 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
291 A2T a2; _Ecs_FromPyObject(objs[2], a2);\
292 A3T a3; _Ecs_FromPyObject(objs[3], a3);\
293 A4T a4; _Ecs_FromPyObject(objs[4], a4);\
294 A5T a5; _Ecs_FromPyObject(objs[5], a5);\
295 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5 );\
296 }\
254 success = false; return RetT();\297 success = false; return RetT();\
255}\298}\
256template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T >\299template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T >\
@@ -264,7 +307,15 @@
264 _Ecs_AppendPythonArgType<A5T>( pyTypes );\307 _Ecs_AppendPythonArgType<A5T>( pyTypes );\
265 _Ecs_AppendPythonArgType<A6T>( pyTypes );\308 _Ecs_AppendPythonArgType<A6T>( pyTypes );\
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] ) )\
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 {\
311 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
312 A2T a2; _Ecs_FromPyObject(objs[2], a2);\
313 A3T a3; _Ecs_FromPyObject(objs[3], a3);\
314 A4T a4; _Ecs_FromPyObject(objs[4], a4);\
315 A5T a5; _Ecs_FromPyObject(objs[5], a5);\
316 A6T a6; _Ecs_FromPyObject(objs[6], a6);\
317 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6 );\
318 }\
268 success = false; return RetT();\319 success = false; return RetT();\
269}\320}\
270template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T >\321template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T >\
@@ -279,7 +330,16 @@
279 _Ecs_AppendPythonArgType<A6T>( pyTypes );\330 _Ecs_AppendPythonArgType<A6T>( pyTypes );\
280 _Ecs_AppendPythonArgType<A7T>( pyTypes );\331 _Ecs_AppendPythonArgType<A7T>( pyTypes );\
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] ) )\
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 {\
334 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
335 A2T a2; _Ecs_FromPyObject(objs[2], a2);\
336 A3T a3; _Ecs_FromPyObject(objs[3], a3);\
337 A4T a4; _Ecs_FromPyObject(objs[4], a4);\
338 A5T a5; _Ecs_FromPyObject(objs[5], a5);\
339 A6T a6; _Ecs_FromPyObject(objs[6], a6);\
340 A7T a7; _Ecs_FromPyObject(objs[7], a7);\
341 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6, a7 );\
342 }\
283 success = false; return RetT();\343 success = false; return RetT();\
284}\344}\
285template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T >\345template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T >\
@@ -295,7 +355,17 @@
295 _Ecs_AppendPythonArgType<A7T>( pyTypes );\355 _Ecs_AppendPythonArgType<A7T>( pyTypes );\
296 _Ecs_AppendPythonArgType<A8T>( pyTypes );\356 _Ecs_AppendPythonArgType<A8T>( pyTypes );\
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] ) )\
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 {\
359 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
360 A2T a2; _Ecs_FromPyObject(objs[2], a2);\
361 A3T a3; _Ecs_FromPyObject(objs[3], a3);\
362 A4T a4; _Ecs_FromPyObject(objs[4], a4);\
363 A5T a5; _Ecs_FromPyObject(objs[5], a5);\
364 A6T a6; _Ecs_FromPyObject(objs[6], a6);\
365 A7T a7; _Ecs_FromPyObject(objs[7], a7);\
366 A8T a8; _Ecs_FromPyObject(objs[8], a8);\
367 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6, a7, a8 );\
368 }\
299 success = false; return RetT();\369 success = false; return RetT();\
300}\370}\
301template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T, class A9T >\371template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T, class A9T >\
@@ -312,7 +382,18 @@
312 _Ecs_AppendPythonArgType<A8T>( pyTypes );\382 _Ecs_AppendPythonArgType<A8T>( pyTypes );\
313 _Ecs_AppendPythonArgType<A9T>( pyTypes );\383 _Ecs_AppendPythonArgType<A9T>( pyTypes );\
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] ) )\
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 {\
386 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
387 A2T a2; _Ecs_FromPyObject(objs[2], a2);\
388 A3T a3; _Ecs_FromPyObject(objs[3], a3);\
389 A4T a4; _Ecs_FromPyObject(objs[4], a4);\
390 A5T a5; _Ecs_FromPyObject(objs[5], a5);\
391 A6T a6; _Ecs_FromPyObject(objs[6], a6);\
392 A7T a7; _Ecs_FromPyObject(objs[7], a7);\
393 A8T a8; _Ecs_FromPyObject(objs[8], a8);\
394 A9T a9; _Ecs_FromPyObject(objs[9], a9);\
395 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6, a7, a8, a9 );\
396 }\
316 success = false; return RetT();\397 success = false; return RetT();\
317}\398}\
318template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T, class A9T, class A10T >\399template< class ObjT, class RetT, class A1T, class A2T, class A3T, class A4T, class A5T, class A6T, class A7T, class A8T, class A9T, class A10T >\
@@ -330,7 +411,19 @@
330 _Ecs_AppendPythonArgType<A9T>( pyTypes );\411 _Ecs_AppendPythonArgType<A9T>( pyTypes );\
331 _Ecs_AppendPythonArgType<A10T>( pyTypes );\412 _Ecs_AppendPythonArgType<A10T>( pyTypes );\
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] ) )\
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 {\
415 A1T a1; _Ecs_FromPyObject(objs[1], a1);\
416 A2T a2; _Ecs_FromPyObject(objs[2], a2);\
417 A3T a3; _Ecs_FromPyObject(objs[3], a3);\
418 A4T a4; _Ecs_FromPyObject(objs[4], a4);\
419 A5T a5; _Ecs_FromPyObject(objs[5], a5);\
420 A6T a6; _Ecs_FromPyObject(objs[6], a6);\
421 A7T a7; _Ecs_FromPyObject(objs[7], a7);\
422 A8T a8; _Ecs_FromPyObject(objs[8], a8);\
423 A9T a9; _Ecs_FromPyObject(objs[9], a9);\
424 A10T a10; _Ecs_FromPyObject(objs[10], a10);\
425 return ( RetT )( ( ObjT* ) objs[0] )->Method( a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 );\
426 }\
334 success = false; return RetT();\427 success = false; return RetT();\
335}428}
336429
@@ -338,10 +431,10 @@
338431
339#define ECS_REGISTER_METHOD_RETURN( Class, Method, ReturnType, ... )\432#define ECS_REGISTER_METHOD_RETURN( Class, Method, ReturnType, ... )\
340_MAKE_METHOD_CALL( Class, Method )\433_MAKE_METHOD_CALL( Class, Method )\
341static PyObject* Class##_##Method( PyObject* self, PyObject* args )\434static PyObject* Class##_##Method( PyObject*, PyObject* args )\
342{\435{\
343 bool success;\436 bool success;\
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 ) );\
345 if( success )\438 if( success )\
346 return result;\439 return result;\
347 else\440 else\
@@ -353,7 +446,7 @@
353446
354#define ECS_REGISTER_METHOD_VOID( Class, Method, ... )\447#define ECS_REGISTER_METHOD_VOID( Class, Method, ... )\
355_MAKE_METHOD_CALL( Class, Method )\448_MAKE_METHOD_CALL( Class, Method )\
356static PyObject* Class##_##Method( PyObject* self, PyObject* args )\449static PyObject* Class##_##Method( PyObject*, PyObject* args )\
357{\450{\
358 bool success;\451 bool success;\
359 Class##_##Call##Method< Class, void, ##__VA_ARGS__ >( args, success );\452 Class##_##Call##Method< Class, void, ##__VA_ARGS__ >( args, success );\
360453
=== added file 'readme_windows.txt'
--- readme_windows.txt 1970-01-01 00:00:00 +0000
+++ readme_windows.txt 2014-12-05 19:42:33 +0000
@@ -0,0 +1,15 @@
1Compiling ECS::Python on Windows:
2
3Firstly, you'll need to ensure that the correct version of Python is
4being referenced in the CMakeLists:
5
6 1. Open CMakeLists.txt
7 2. Update the paths under "if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")"
8
9Secondly, the Python distro does not come packaged with the debug library:
10"pythonXX_d.lib". So, in order to get ECS:Python to compile in Debug mode:
11
12 1. Open: "PythonXX\include\pyconfig.h"
13 2. Comment out the line "# define Py_DEBUG
14"
15 3. Search and replace "_d.lib" with ".lib"
0\ No newline at end of file16\ No newline at end of file
117
=== modified file 'src/EcsMacros.cpp'
--- src/EcsMacros.cpp 2014-01-25 10:46:21 +0000
+++ src/EcsMacros.cpp 2014-12-05 19:42:33 +0000
@@ -1,6 +1,6 @@
1/************************************************************************1/************************************************************************
2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++
3Copyright (c) 2012-2013 Marcus Tomlinson3Copyright (c) 2012-2014 Marcus Tomlinson
44
5This file is part of EcsPython.5This file is part of EcsPython.
66
@@ -37,45 +37,49 @@
3737
38//=================================================================================================38//=================================================================================================
3939
40DLLPORT int (*_Ecs_ParseTuple)( PyObject *, const char *, ... ) = NULL;40int (*_Ecs_ParseTuple)( PyObject *, const char *, ... ) = NULL;
4141
42//template PyObject* _Ecs_GetPythonReturnValue( const char*& );42typedef char* charptr;
43template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const std::string& );43typedef void* voidptr;
44template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const char& );44
45template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned char& );45template PyObject* _Ecs_ToPyObject( const charptr& );
46template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const short& );46template PyObject* _Ecs_ToPyObject( const std::string& );
47template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned short& );47template PyObject* _Ecs_ToPyObject( const char& );
48template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const int& );48template PyObject* _Ecs_ToPyObject( const unsigned char& );
49template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned int& );49template PyObject* _Ecs_ToPyObject( const short& );
50template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const long& );50template PyObject* _Ecs_ToPyObject( const unsigned short& );
51template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned long& );51template PyObject* _Ecs_ToPyObject( const int& );
52template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const long long& );52template PyObject* _Ecs_ToPyObject( const unsigned int& );
53template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const unsigned long long& );53template PyObject* _Ecs_ToPyObject( const long& );
54template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const bool& );54template PyObject* _Ecs_ToPyObject( const unsigned long& );
55template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const double& );55template PyObject* _Ecs_ToPyObject( const long long& );
56template DLLEXPORT PyObject* _Ecs_GetPythonReturnValue( const float& );56template PyObject* _Ecs_ToPyObject( const unsigned long long& );
57template PyObject* _Ecs_ToPyObject( const bool& );
58template PyObject* _Ecs_ToPyObject( const double& );
59template PyObject* _Ecs_ToPyObject( const float& );
60template PyObject* _Ecs_ToPyObject( const voidptr& );
5761
58//=================================================================================================62//=================================================================================================
5963
60void _EcsAddNewMethod( const char *methodName, PyCFunction methodPointer, int methodFlags )64void _EcsAddNewMethod( const char *methodName, PyCFunction methodPointer, int methodFlags )
61{65{
62if( _Ecs_ParseTuple == NULL )66 if( _Ecs_ParseTuple == NULL )
63{67 {
64_Ecs_ParseTuple = PyArg_ParseTuple;68 _Ecs_ParseTuple = PyArg_ParseTuple;
65}69 }
6670
67PyMethodDef newMethod = { methodName, methodPointer, methodFlags };71 PyMethodDef newMethod = { methodName, methodPointer, methodFlags, NULL };
68EcsPythonMethods.push_back( newMethod );72 EcsPythonMethods.push_back( newMethod );
69}73}
7074
71//-------------------------------------------------------------------------------------------------75//-------------------------------------------------------------------------------------------------
7276
73template< class Type >77template< class Type >
74PyObject* _Ecs_GetPythonReturnValue( const Type& Value )78PyObject* _Ecs_ToPyObject( const Type& Value )
75{79{
76 if( typeid( Type ) == typeid( char* ) )80 if( typeid( Type ) == typeid( char* ) )
77 return PyUnicode_FromFormat( "%s", *((char**)(&Value)) );81 return PyUnicode_FromFormat( "%s", *((char**)(&Value)) );
78 if( typeid( Type ) == typeid( std::string ) )82 else if( typeid( Type ) == typeid( std::string ) )
79 return PyUnicode_FromFormat( "%s", (*((std::string*)(&Value))).c_str() );83 return PyUnicode_FromFormat( "%s", (*((std::string*)(&Value))).c_str() );
80 else if( typeid( Type ) == typeid( char ) )84 else if( typeid( Type ) == typeid( char ) )
81 return PyUnicode_FromFormat( "%c", *((char*)(&Value)) );85 return PyUnicode_FromFormat( "%c", *((char*)(&Value)) );
@@ -103,6 +107,8 @@
103 return PyFloat_FromDouble( *((double*)(&Value)) );107 return PyFloat_FromDouble( *((double*)(&Value)) );
104 else if( typeid( Type ) == typeid( float ) )108 else if( typeid( Type ) == typeid( float ) )
105 return PyFloat_FromDouble( *((float*)(&Value)) );109 return PyFloat_FromDouble( *((float*)(&Value)) );
110 else if( typeid( Type ) == typeid( void* ) )
111 return PyLong_FromUnsignedLong( *((unsigned long*)(&Value)) );
106 else112 else
107 return NULL;113 return NULL;
108}114}
109115
=== modified file 'src/EcsPython.cpp'
--- src/EcsPython.cpp 2014-01-26 12:29:03 +0000
+++ src/EcsPython.cpp 2014-12-05 19:42:33 +0000
@@ -1,6 +1,6 @@
1/************************************************************************1/************************************************************************
2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++2ECS:Python - Light-Weight C++ Wrapper For Embedding Python Into C++
3Copyright (c) 2012-2013 Marcus Tomlinson3Copyright (c) 2012-2014 Marcus Tomlinson
44
5This file is part of EcsPython.5This file is part of EcsPython.
66
@@ -43,14 +43,14 @@
43// EcsPython Globals43// EcsPython Globals
44// =================44// =================
4545
46DLLPORT DspMutex EcsPythonCmdMutex; // Mutex for thread-safe python calls46DspMutex EcsPythonCmdMutex; // Mutex for thread-safe python calls
47DLLPORT std::vector< EcsClass* > EcsPythonClassesDict; // C++ class dictionary47std::vector< EcsClass* > EcsPythonClassesDict; // C++ class dictionary
48DLLPORT std::string EcsPythonClassesDef; // Python definition string for C++ classes 48std::string EcsPythonClassesDef; // Python definition string for C++ classes
49DLLPORT std::vector< PyMethodDef > EcsPythonMethods; // Methods for EcsPython python module49std::vector< PyMethodDef > EcsPythonMethods; // Methods for EcsPython python module
50DLLPORT std::vector< EcsObject* > EcsExposedObjects; // C++ objects exposed to Python50std::vector< EcsObject* > EcsExposedObjects; // C++ objects exposed to Python
5151
52#if PY_MAJOR_VERSION >= 352#if PY_MAJOR_VERSION >= 3
53DLLPORT struct PyModuleDef EcsPythonModule; // EcsPython python module53struct PyModuleDef EcsPythonModule; // EcsPython python module
54#endif54#endif
5555
56//=================================================================================================56//=================================================================================================
@@ -75,7 +75,7 @@
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 );
76 }76 }
7777
78 EcsPythonMethods.pop_back(); // pop the NULL off the end of the methods array so that more can be added later78 EcsPythonMethods.pop_back(); // pop the NULL off the end of the methods array so that more can be added later
79}79}
8080
81//-------------------------------------------------------------------------------------------------81//-------------------------------------------------------------------------------------------------
@@ -171,7 +171,7 @@
171{171{
172 PyMethodDef nullMethod =172 PyMethodDef nullMethod =
173 {173 {
174 NULL, NULL, 0174 NULL, NULL, 0, NULL
175 };175 };
176 EcsPythonMethods.push_back( nullMethod );176 EcsPythonMethods.push_back( nullMethod );
177177
@@ -209,11 +209,7 @@
209 module = PyImport_ImportModule( "__main__" );209 module = PyImport_ImportModule( "__main__" );
210 PyObject_SetAttrString( module, "ecsPtr", newPyObject );210 PyObject_SetAttrString( module, "ecsPtr", newPyObject );
211211
212 pythonCall.append( pyObjectName ).append( " = " ).append( pyClassName ).append( "()" );212 pythonCall.append( pyObjectName ).append( " = " ).append( pyClassName ).append( "(ecsPtr)" );
213 Ecs_Python_Cmd( pythonCall );
214
215 pythonCall.clear();
216 pythonCall.append( pyObjectName ).append( ".SetEcsPtr(ecsPtr)" );
217 Ecs_Python_Cmd( pythonCall );213 Ecs_Python_Cmd( pythonCall );
218214
219 Ecs_Python_Cmd( "del ecsPtr" );215 Ecs_Python_Cmd( "del ecsPtr" );
220216
=== removed directory 'win_fix'
=== removed directory 'win_fix/Python27'
=== removed file 'win_fix/Python27/pyconfig.h'
--- win_fix/Python27/pyconfig.h 2014-01-17 13:26:46 +0000
+++ win_fix/Python27/pyconfig.h 1970-01-01 00:00:00 +0000
@@ -1,756 +0,0 @@
1#ifndef Py_CONFIG_H
2#define Py_CONFIG_H
3
4/* pyconfig.h. NOT Generated automatically by configure.
5
6This is a manually maintained version used for the Watcom,
7Borland and Microsoft Visual C++ compilers. It is a
8standard part of the Python distribution.
9
10WINDOWS DEFINES:
11The code specific to Windows should be wrapped around one of
12the following #defines
13
14MS_WIN64 - Code specific to the MS Win64 API
15MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs)
16MS_WINDOWS - Code specific to Windows, but all versions.
17MS_WINCE - Code specific to Windows CE
18Py_ENABLE_SHARED - Code if the Python core is built as a DLL.
19
20Also note that neither "_M_IX86" or "_MSC_VER" should be used for
21any purpose other than "Windows Intel x86 specific" and "Microsoft
22compiler specific". Therefore, these should be very rare.
23
24
25NOTE: The following symbols are deprecated:
26NT, USE_DL_EXPORT, USE_DL_IMPORT, DL_EXPORT, DL_IMPORT
27MS_CORE_DLL.
28
29WIN32 is still required for the locale module.
30
31*/
32
33#ifdef _WIN32_WCE
34#define MS_WINCE
35#endif
36
37/* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */
38#ifdef USE_DL_EXPORT
39# define Py_BUILD_CORE
40#endif /* USE_DL_EXPORT */
41
42/* Visual Studio 2005 introduces deprecation warnings for
43 "insecure" and POSIX functions. The insecure functions should
44 be replaced by *_s versions (according to Microsoft); the
45 POSIX functions by _* versions (which, according to Microsoft,
46 would be ISO C conforming). Neither renaming is feasible, so
47 we just silence the warnings. */
48
49#ifndef _CRT_SECURE_NO_DEPRECATE
50#define _CRT_SECURE_NO_DEPRECATE 1
51#endif
52#ifndef _CRT_NONSTDC_NO_DEPRECATE
53#define _CRT_NONSTDC_NO_DEPRECATE 1
54#endif
55
56/* Windows CE does not have these */
57#ifndef MS_WINCE
58#define HAVE_IO_H
59#define HAVE_SYS_UTIME_H
60#define HAVE_TEMPNAM
61#define HAVE_TMPFILE
62#define HAVE_TMPNAM
63#define HAVE_CLOCK
64#define HAVE_STRERROR
65#endif
66
67#ifdef HAVE_IO_H
68#include <io.h>
69#endif
70
71#define HAVE_HYPOT
72#define HAVE_STRFTIME
73#define DONT_HAVE_SIG_ALARM
74#define DONT_HAVE_SIG_PAUSE
75#define LONG_BIT 32
76#define WORD_BIT 32
77#define PREFIX ""
78#define EXEC_PREFIX ""
79
80#define MS_WIN32 /* only support win32 and greater. */
81#define MS_WINDOWS
82#ifndef PYTHONPATH
83# define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk"
84#endif
85#define NT_THREADS
86#define WITH_THREAD
87#ifndef NETSCAPE_PI
88#define USE_SOCKET
89#endif
90
91/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */
92#if defined(MS_WINCE)
93# include <stdlib.h>
94# define strdup _strdup
95#endif
96
97#ifdef MS_WINCE
98/* Windows CE does not support environment variables */
99#define getenv(v) (NULL)
100#define environ (NULL)
101#endif
102
103/* Compiler specific defines */
104
105/* ------------------------------------------------------------------------*/
106/* Microsoft C defines _MSC_VER */
107#ifdef _MSC_VER
108
109/* We want COMPILER to expand to a string containing _MSC_VER's *value*.
110 * This is horridly tricky, because the stringization operator only works
111 * on macro arguments, and doesn't evaluate macros passed *as* arguments.
112 * Attempts simpler than the following appear doomed to produce "_MSC_VER"
113 * literally in the string.
114 */
115#define _Py_PASTE_VERSION(SUFFIX) \
116 ("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]")
117/* e.g., this produces, after compile-time string catenation,
118 * ("[MSC v.1200 32 bit (Intel)]")
119 *
120 * _Py_STRINGIZE(_MSC_VER) expands to
121 * _Py_STRINGIZE1((_MSC_VER)) expands to
122 * _Py_STRINGIZE2(_MSC_VER) but as this call is the result of token-pasting
123 * it's scanned again for macros and so further expands to (under MSVC 6)
124 * _Py_STRINGIZE2(1200) which then expands to
125 * "1200"
126 */
127#define _Py_STRINGIZE(X) _Py_STRINGIZE1((X))
128#define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X
129#define _Py_STRINGIZE2(X) #X
130
131/* MSVC defines _WINxx to differentiate the windows platform types
132
133 Note that for compatibility reasons _WIN32 is defined on Win32
134 *and* on Win64. For the same reasons, in Python, MS_WIN32 is
135 defined on Win32 *and* Win64. Win32 only code must therefore be
136 guarded as follows:
137 #if defined(MS_WIN32) && !defined(MS_WIN64)
138 Some modules are disabled on Itanium processors, therefore we
139 have MS_WINI64 set for those targets, otherwise MS_WINX64
140*/
141#ifdef _WIN64
142#define MS_WIN64
143#endif
144
145/* set the COMPILER */
146#ifdef MS_WIN64
147#if defined(_M_IA64)
148#define COMPILER _Py_PASTE_VERSION("64 bit (Itanium)")
149#define MS_WINI64
150#elif defined(_M_X64) || defined(_M_AMD64)
151#define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)")
152#define MS_WINX64
153#else
154#define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)")
155#endif
156#endif /* MS_WIN64 */
157
158/* set the version macros for the windows headers */
159#ifdef MS_WINX64
160/* 64 bit only runs on XP or greater */
161#define Py_WINVER _WIN32_WINNT_WINXP
162#define Py_NTDDI NTDDI_WINXP
163#else
164/* Python 2.6+ requires Windows 2000 or greater */
165#ifdef _WIN32_WINNT_WIN2K
166#define Py_WINVER _WIN32_WINNT_WIN2K
167#else
168#define Py_WINVER 0x0500
169#endif
170#define Py_NTDDI NTDDI_WIN2KSP4
171#endif
172
173/* We only set these values when building Python - we don't want to force
174 these values on extensions, as that will affect the prototypes and
175 structures exposed in the Windows headers. Even when building Python, we
176 allow a single source file to override this - they may need access to
177 structures etc so it can optionally use new Windows features if it
178 determines at runtime they are available.
179*/
180#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_MODULE)
181#ifndef NTDDI_VERSION
182#define NTDDI_VERSION Py_NTDDI
183#endif
184#ifndef WINVER
185#define WINVER Py_WINVER
186#endif
187#ifndef _WIN32_WINNT
188#define _WIN32_WINNT Py_WINVER
189#endif
190#endif
191
192/* _W64 is not defined for VC6 or eVC4 */
193#ifndef _W64
194#define _W64
195#endif
196
197/* Define like size_t, omitting the "unsigned" */
198#ifdef MS_WIN64
199typedef __int64 ssize_t;
200#else
201typedef _W64 int ssize_t;
202#endif
203#define HAVE_SSIZE_T 1
204
205#if defined(MS_WIN32) && !defined(MS_WIN64)
206#ifdef _M_IX86
207#define COMPILER _Py_PASTE_VERSION("32 bit (Intel)")
208#else
209#define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)")
210#endif
211#endif /* MS_WIN32 && !MS_WIN64 */
212
213typedef int pid_t;
214
215#include <float.h>
216#define Py_IS_NAN _isnan
217#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))
218#define Py_IS_FINITE(X) _finite(X)
219#define copysign _copysign
220#define hypot _hypot
221
222#endif /* _MSC_VER */
223
224/* define some ANSI types that are not defined in earlier Win headers */
225#if defined(_MSC_VER) && _MSC_VER >= 1200
226/* This file only exists in VC 6.0 or higher */
227#include <basetsd.h>
228#endif
229
230/* ------------------------------------------------------------------------*/
231/* The Borland compiler defines __BORLANDC__ */
232/* XXX These defines are likely incomplete, but should be easy to fix. */
233#ifdef __BORLANDC__
234#define COMPILER "[Borland]"
235
236#ifdef _WIN32
237/* tested with BCC 5.5 (__BORLANDC__ >= 0x0550)
238 */
239
240typedef int pid_t;
241/* BCC55 seems to understand __declspec(dllimport), it is used in its
242 own header files (winnt.h, ...) - so we can do nothing and get the default*/
243
244#undef HAVE_SYS_UTIME_H
245#define HAVE_UTIME_H
246#define HAVE_DIRENT_H
247
248/* rename a few functions for the Borland compiler */
249#include <io.h>
250#define _chsize chsize
251#define _setmode setmode
252
253#else /* !_WIN32 */
254#error "Only Win32 and later are supported"
255#endif /* !_WIN32 */
256
257#endif /* BORLANDC */
258
259/* ------------------------------------------------------------------------*/
260/* egcs/gnu-win32 defines __GNUC__ and _WIN32 */
261#if defined(__GNUC__) && defined(_WIN32)
262/* XXX These defines are likely incomplete, but should be easy to fix.
263 They should be complete enough to build extension modules. */
264/* Suggested by Rene Liebscher <R.Liebscher@gmx.de> to avoid a GCC 2.91.*
265 bug that requires structure imports. More recent versions of the
266 compiler don't exhibit this bug.
267*/
268#if (__GNUC__==2) && (__GNUC_MINOR__<=91)
269#warning "Please use an up-to-date version of gcc! (>2.91 recommended)"
270#endif
271
272#define COMPILER "[gcc]"
273#define hypot _hypot
274#define PY_LONG_LONG long long
275#define PY_LLONG_MIN LLONG_MIN
276#define PY_LLONG_MAX LLONG_MAX
277#define PY_ULLONG_MAX ULLONG_MAX
278#endif /* GNUC */
279
280/* ------------------------------------------------------------------------*/
281/* lcc-win32 defines __LCC__ */
282#if defined(__LCC__)
283/* XXX These defines are likely incomplete, but should be easy to fix.
284 They should be complete enough to build extension modules. */
285
286#define COMPILER "[lcc-win32]"
287typedef int pid_t;
288/* __declspec() is supported here too - do nothing to get the defaults */
289
290#endif /* LCC */
291
292/* ------------------------------------------------------------------------*/
293/* End of compilers - finish up */
294
295#ifndef NO_STDIO_H
296# include <stdio.h>
297#endif
298
299/* 64 bit ints are usually spelt __int64 unless compiler has overridden */
300#define HAVE_LONG_LONG 1
301#ifndef PY_LONG_LONG
302# define PY_LONG_LONG __int64
303# define PY_LLONG_MAX _I64_MAX
304# define PY_LLONG_MIN _I64_MIN
305# define PY_ULLONG_MAX _UI64_MAX
306#endif
307
308/* For Windows the Python core is in a DLL by default. Test
309Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
310#if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED)
311# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
312# define MS_COREDLL /* deprecated old symbol */
313#endif /* !MS_NO_COREDLL && ... */
314
315/* All windows compilers that use this header support __declspec */
316#define HAVE_DECLSPEC_DLL
317
318/* For an MSVC DLL, we can nominate the .lib files used by extensions */
319#ifdef MS_COREDLL
320# ifndef Py_BUILD_CORE /* not building the core - must be an ext */
321# if defined(_MSC_VER)
322 /* So MSVC users need not specify the .lib file in
323 their Makefile (other compilers are generally
324 taken care of by distutils.) */
325# ifdef _DEBUG
326# pragma comment(lib,"python27.lib")
327# else
328# pragma comment(lib,"python27.lib")
329# endif /* _DEBUG */
330# endif /* _MSC_VER */
331# endif /* Py_BUILD_CORE */
332#endif /* MS_COREDLL */
333
334#if defined(MS_WIN64)
335/* maintain "win32" sys.platform for backward compatibility of Python code,
336 the Win64 API should be close enough to the Win32 API to make this
337 preferable */
338# define PLATFORM "win32"
339# define SIZEOF_VOID_P 8
340# define SIZEOF_TIME_T 8
341# define SIZEOF_OFF_T 4
342# define SIZEOF_FPOS_T 8
343# define SIZEOF_HKEY 8
344# define SIZEOF_SIZE_T 8
345/* configure.in defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG,
346 sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t).
347 On Win64 the second condition is not true, but if fpos_t replaces off_t
348 then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64
349 should define this. */
350# define HAVE_LARGEFILE_SUPPORT
351#elif defined(MS_WIN32)
352# define PLATFORM "win32"
353# define HAVE_LARGEFILE_SUPPORT
354# define SIZEOF_VOID_P 4
355# define SIZEOF_OFF_T 4
356# define SIZEOF_FPOS_T 8
357# define SIZEOF_HKEY 4
358# define SIZEOF_SIZE_T 4
359 /* MS VS2005 changes time_t to an 64-bit type on all platforms */
360# if defined(_MSC_VER) && _MSC_VER >= 1400
361# define SIZEOF_TIME_T 8
362# else
363# define SIZEOF_TIME_T 4
364# endif
365#endif
366
367#ifdef _DEBUG
368//# define Py_DEBUG
369#endif
370
371
372#ifdef MS_WIN32
373
374#define SIZEOF_SHORT 2
375#define SIZEOF_INT 4
376#define SIZEOF_LONG 4
377#define SIZEOF_LONG_LONG 8
378#define SIZEOF_DOUBLE 8
379#define SIZEOF_FLOAT 4
380
381/* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200.
382 Microsoft eMbedded Visual C++ 4.0 has a version number of 1201 and doesn't
383 define these.
384 If some compiler does not provide them, modify the #if appropriately. */
385#if defined(_MSC_VER)
386#if _MSC_VER > 1300
387#define HAVE_UINTPTR_T 1
388#define HAVE_INTPTR_T 1
389#else
390/* VC6, VS 2002 and eVC4 don't support the C99 LL suffix for 64-bit integer literals */
391#define Py_LL(x) x##I64
392#endif /* _MSC_VER > 1200 */
393#endif /* _MSC_VER */
394
395#endif
396
397/* define signed and unsigned exact-width 32-bit and 64-bit types, used in the
398 implementation of Python long integers. */
399#ifndef PY_UINT32_T
400#if SIZEOF_INT == 4
401#define HAVE_UINT32_T 1
402#define PY_UINT32_T unsigned int
403#elif SIZEOF_LONG == 4
404#define HAVE_UINT32_T 1
405#define PY_UINT32_T unsigned long
406#endif
407#endif
408
409#ifndef PY_UINT64_T
410#if SIZEOF_LONG_LONG == 8
411#define HAVE_UINT64_T 1
412#define PY_UINT64_T unsigned PY_LONG_LONG
413#endif
414#endif
415
416#ifndef PY_INT32_T
417#if SIZEOF_INT == 4
418#define HAVE_INT32_T 1
419#define PY_INT32_T int
420#elif SIZEOF_LONG == 4
421#define HAVE_INT32_T 1
422#define PY_INT32_T long
423#endif
424#endif
425
426#ifndef PY_INT64_T
427#if SIZEOF_LONG_LONG == 8
428#define HAVE_INT64_T 1
429#define PY_INT64_T PY_LONG_LONG
430#endif
431#endif
432
433/* Fairly standard from here! */
434
435/* Define to 1 if you have the `copysign' function. */
436#define HAVE_COPYSIGN 1
437
438/* Define to 1 if you have the `isinf' macro. */
439#define HAVE_DECL_ISINF 1
440
441/* Define to 1 if you have the `isnan' function. */
442#define HAVE_DECL_ISNAN 1
443
444/* Define if on AIX 3.
445 System headers sometimes define this.
446 We just want to avoid a redefinition error message. */
447#ifndef _ALL_SOURCE
448/* #undef _ALL_SOURCE */
449#endif
450
451/* Define to empty if the keyword does not work. */
452/* #define const */
453
454/* Define to 1 if you have the <conio.h> header file. */
455#ifndef MS_WINCE
456#define HAVE_CONIO_H 1
457#endif
458
459/* Define to 1 if you have the <direct.h> header file. */
460#ifndef MS_WINCE
461#define HAVE_DIRECT_H 1
462#endif
463
464/* Define if you have dirent.h. */
465/* #define DIRENT 1 */
466
467/* Define to the type of elements in the array set by `getgroups'.
468 Usually this is either `int' or `gid_t'. */
469/* #undef GETGROUPS_T */
470
471/* Define to `int' if <sys/types.h> doesn't define. */
472/* #undef gid_t */
473
474/* Define if your struct tm has tm_zone. */
475/* #undef HAVE_TM_ZONE */
476
477/* Define if you don't have tm_zone but do have the external array
478 tzname. */
479#define HAVE_TZNAME
480
481/* Define to `int' if <sys/types.h> doesn't define. */
482/* #undef mode_t */
483
484/* Define if you don't have dirent.h, but have ndir.h. */
485/* #undef NDIR */
486
487/* Define to `long' if <sys/types.h> doesn't define. */
488/* #undef off_t */
489
490/* Define to `int' if <sys/types.h> doesn't define. */
491/* #undef pid_t */
492
493/* Define if the system does not provide POSIX.1 features except
494 with this defined. */
495/* #undef _POSIX_1_SOURCE */
496
497/* Define if you need to in order for stat and other things to work. */
498/* #undef _POSIX_SOURCE */
499
500/* Define as the return type of signal handlers (int or void). */
501#define RETSIGTYPE void
502
503/* Define to `unsigned' if <sys/types.h> doesn't define. */
504/* #undef size_t */
505
506/* Define if you have the ANSI C header files. */
507#define STDC_HEADERS 1
508
509/* Define if you don't have dirent.h, but have sys/dir.h. */
510/* #undef SYSDIR */
511
512/* Define if you don't have dirent.h, but have sys/ndir.h. */
513/* #undef SYSNDIR */
514
515/* Define if you can safely include both <sys/time.h> and <time.h>. */
516/* #undef TIME_WITH_SYS_TIME */
517
518/* Define if your <sys/time.h> declares struct tm. */
519/* #define TM_IN_SYS_TIME 1 */
520
521/* Define to `int' if <sys/types.h> doesn't define. */
522/* #undef uid_t */
523
524/* Define if the closedir function returns void instead of int. */
525/* #undef VOID_CLOSEDIR */
526
527/* Define if getpgrp() must be called as getpgrp(0)
528 and (consequently) setpgrp() as setpgrp(0, 0). */
529/* #undef GETPGRP_HAVE_ARGS */
530
531/* Define this if your time.h defines altzone */
532/* #define HAVE_ALTZONE */
533
534/* Define if you have the putenv function. */
535#ifndef MS_WINCE
536#define HAVE_PUTENV
537#endif
538
539/* Define if your compiler supports function prototypes */
540#define HAVE_PROTOTYPES
541
542/* Define if you can safely include both <sys/select.h> and <sys/time.h>
543 (which you can't on SCO ODT 3.0). */
544/* #undef SYS_SELECT_WITH_SYS_TIME */
545
546/* Define if you want documentation strings in extension modules */
547#define WITH_DOC_STRINGS 1
548
549/* Define if you want to compile in rudimentary thread support */
550/* #undef WITH_THREAD */
551
552/* Define if you want to use the GNU readline library */
553/* #define WITH_READLINE 1 */
554
555/* Define if you want to have a Unicode type. */
556#define Py_USING_UNICODE
557
558/* Define as the size of the unicode type. */
559/* This is enough for unicodeobject.h to do the "right thing" on Windows. */
560#define Py_UNICODE_SIZE 2
561
562/* Use Python's own small-block memory-allocator. */
563#define WITH_PYMALLOC 1
564
565/* Define if you have clock. */
566/* #define HAVE_CLOCK */
567
568/* Define when any dynamic module loading is enabled */
569#define HAVE_DYNAMIC_LOADING
570
571/* Define if you have ftime. */
572#ifndef MS_WINCE
573#define HAVE_FTIME
574#endif
575
576/* Define if you have getpeername. */
577#define HAVE_GETPEERNAME
578
579/* Define if you have getpgrp. */
580/* #undef HAVE_GETPGRP */
581
582/* Define if you have getpid. */
583#ifndef MS_WINCE
584#define HAVE_GETPID
585#endif
586
587/* Define if you have gettimeofday. */
588/* #undef HAVE_GETTIMEOFDAY */
589
590/* Define if you have getwd. */
591/* #undef HAVE_GETWD */
592
593/* Define if you have lstat. */
594/* #undef HAVE_LSTAT */
595
596/* Define if you have the mktime function. */
597#define HAVE_MKTIME
598
599/* Define if you have nice. */
600/* #undef HAVE_NICE */
601
602/* Define if you have readlink. */
603/* #undef HAVE_READLINK */
604
605/* Define if you have select. */
606/* #undef HAVE_SELECT */
607
608/* Define if you have setpgid. */
609/* #undef HAVE_SETPGID */
610
611/* Define if you have setpgrp. */
612/* #undef HAVE_SETPGRP */
613
614/* Define if you have setsid. */
615/* #undef HAVE_SETSID */
616
617/* Define if you have setvbuf. */
618#define HAVE_SETVBUF
619
620/* Define if you have siginterrupt. */
621/* #undef HAVE_SIGINTERRUPT */
622
623/* Define if you have symlink. */
624/* #undef HAVE_SYMLINK */
625
626/* Define if you have tcgetpgrp. */
627/* #undef HAVE_TCGETPGRP */
628
629/* Define if you have tcsetpgrp. */
630/* #undef HAVE_TCSETPGRP */
631
632/* Define if you have times. */
633/* #undef HAVE_TIMES */
634
635/* Define if you have uname. */
636/* #undef HAVE_UNAME */
637
638/* Define if you have waitpid. */
639/* #undef HAVE_WAITPID */
640
641/* Define to 1 if you have the `wcscoll' function. */
642#ifndef MS_WINCE
643#define HAVE_WCSCOLL 1
644#endif
645
646/* Define if you have the <dlfcn.h> header file. */
647/* #undef HAVE_DLFCN_H */
648
649/* Define to 1 if you have the <errno.h> header file. */
650#ifndef MS_WINCE
651#define HAVE_ERRNO_H 1
652#endif
653
654/* Define if you have the <fcntl.h> header file. */
655#ifndef MS_WINCE
656#define HAVE_FCNTL_H 1
657#endif
658
659/* Define to 1 if you have the <process.h> header file. */
660#ifndef MS_WINCE
661#define HAVE_PROCESS_H 1
662#endif
663
664/* Define to 1 if you have the <signal.h> header file. */
665#ifndef MS_WINCE
666#define HAVE_SIGNAL_H 1
667#endif
668
669/* Define if you have the <stdarg.h> prototypes. */
670#define HAVE_STDARG_PROTOTYPES
671
672/* Define if you have the <stddef.h> header file. */
673#define HAVE_STDDEF_H 1
674
675/* Define if you have the <sys/audioio.h> header file. */
676/* #undef HAVE_SYS_AUDIOIO_H */
677
678/* Define if you have the <sys/param.h> header file. */
679/* #define HAVE_SYS_PARAM_H 1 */
680
681/* Define if you have the <sys/select.h> header file. */
682/* #define HAVE_SYS_SELECT_H 1 */
683
684/* Define to 1 if you have the <sys/stat.h> header file. */
685#ifndef MS_WINCE
686#define HAVE_SYS_STAT_H 1
687#endif
688
689/* Define if you have the <sys/time.h> header file. */
690/* #define HAVE_SYS_TIME_H 1 */
691
692/* Define if you have the <sys/times.h> header file. */
693/* #define HAVE_SYS_TIMES_H 1 */
694
695/* Define to 1 if you have the <sys/types.h> header file. */
696#ifndef MS_WINCE
697#define HAVE_SYS_TYPES_H 1
698#endif
699
700/* Define if you have the <sys/un.h> header file. */
701/* #define HAVE_SYS_UN_H 1 */
702
703/* Define if you have the <sys/utime.h> header file. */
704/* #define HAVE_SYS_UTIME_H 1 */
705
706/* Define if you have the <sys/utsname.h> header file. */
707/* #define HAVE_SYS_UTSNAME_H 1 */
708
709/* Define if you have the <thread.h> header file. */
710/* #undef HAVE_THREAD_H */
711
712/* Define if you have the <unistd.h> header file. */
713/* #define HAVE_UNISTD_H 1 */
714
715/* Define if you have the <utime.h> header file. */
716/* #define HAVE_UTIME_H 1 */
717
718/* Define if the compiler provides a wchar.h header file. */
719#define HAVE_WCHAR_H 1
720
721/* Define if you have the dl library (-ldl). */
722/* #undef HAVE_LIBDL */
723
724/* Define if you have the mpc library (-lmpc). */
725/* #undef HAVE_LIBMPC */
726
727/* Define if you have the nsl library (-lnsl). */
728#define HAVE_LIBNSL 1
729
730/* Define if you have the seq library (-lseq). */
731/* #undef HAVE_LIBSEQ */
732
733/* Define if you have the socket library (-lsocket). */
734#define HAVE_LIBSOCKET 1
735
736/* Define if you have the sun library (-lsun). */
737/* #undef HAVE_LIBSUN */
738
739/* Define if you have the termcap library (-ltermcap). */
740/* #undef HAVE_LIBTERMCAP */
741
742/* Define if you have the termlib library (-ltermlib). */
743/* #undef HAVE_LIBTERMLIB */
744
745/* Define if you have the thread library (-lthread). */
746/* #undef HAVE_LIBTHREAD */
747
748/* WinSock does not use a bitmask in select, and uses
749 socket handles greater than FD_SETSIZE */
750#define Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE
751
752/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
753 least significant byte first */
754#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
755
756#endif /* !Py_CONFIG_H */
7570
=== removed directory 'win_fix/Python33'
=== removed file 'win_fix/Python33/pyconfig.h'
--- win_fix/Python33/pyconfig.h 2014-01-17 13:26:46 +0000
+++ win_fix/Python33/pyconfig.h 1970-01-01 00:00:00 +0000
@@ -1,765 +0,0 @@
1#ifndef Py_CONFIG_H
2#define Py_CONFIG_H
3
4/* pyconfig.h. NOT Generated automatically by configure.
5
6This is a manually maintained version used for the Watcom,
7Borland and Microsoft Visual C++ compilers. It is a
8standard part of the Python distribution.
9
10WINDOWS DEFINES:
11The code specific to Windows should be wrapped around one of
12the following #defines
13
14MS_WIN64 - Code specific to the MS Win64 API
15MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs)
16MS_WINDOWS - Code specific to Windows, but all versions.
17MS_WINCE - Code specific to Windows CE
18Py_ENABLE_SHARED - Code if the Python core is built as a DLL.
19
20Also note that neither "_M_IX86" or "_MSC_VER" should be used for
21any purpose other than "Windows Intel x86 specific" and "Microsoft
22compiler specific". Therefore, these should be very rare.
23
24
25NOTE: The following symbols are deprecated:
26NT, USE_DL_EXPORT, USE_DL_IMPORT, DL_EXPORT, DL_IMPORT
27MS_CORE_DLL.
28
29WIN32 is still required for the locale module.
30
31*/
32
33#ifdef _WIN32_WCE
34#define MS_WINCE
35#endif
36
37/* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */
38#ifdef USE_DL_EXPORT
39# define Py_BUILD_CORE
40#endif /* USE_DL_EXPORT */
41
42/* Visual Studio 2005 introduces deprecation warnings for
43 "insecure" and POSIX functions. The insecure functions should
44 be replaced by *_s versions (according to Microsoft); the
45 POSIX functions by _* versions (which, according to Microsoft,
46 would be ISO C conforming). Neither renaming is feasible, so
47 we just silence the warnings. */
48
49#ifndef _CRT_SECURE_NO_DEPRECATE
50#define _CRT_SECURE_NO_DEPRECATE 1
51#endif
52#ifndef _CRT_NONSTDC_NO_DEPRECATE
53#define _CRT_NONSTDC_NO_DEPRECATE 1
54#endif
55
56/* Windows CE does not have these */
57#ifndef MS_WINCE
58#define HAVE_IO_H
59#define HAVE_SYS_UTIME_H
60#define HAVE_TEMPNAM
61#define HAVE_TMPFILE
62#define HAVE_TMPNAM
63#define HAVE_CLOCK
64#define HAVE_STRERROR
65#endif
66
67#ifdef HAVE_IO_H
68#include <io.h>
69#endif
70
71#define HAVE_HYPOT
72#define HAVE_STRFTIME
73#define DONT_HAVE_SIG_ALARM
74#define DONT_HAVE_SIG_PAUSE
75#define LONG_BIT 32
76#define WORD_BIT 32
77#define PREFIX ""
78#define EXEC_PREFIX ""
79
80#define MS_WIN32 /* only support win32 and greater. */
81#define MS_WINDOWS
82#ifndef PYTHONPATH
83# define PYTHONPATH L".\\DLLs;.\\lib"
84#endif
85#define NT_THREADS
86#define WITH_THREAD
87#ifndef NETSCAPE_PI
88#define USE_SOCKET
89#endif
90
91/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */
92#if defined(MS_WINCE)
93# include <stdlib.h>
94# define strdup _strdup
95#endif
96
97#ifdef MS_WINCE
98/* Windows CE does not support environment variables */
99#define getenv(v) (NULL)
100#define environ (NULL)
101#endif
102
103/* Compiler specific defines */
104
105/* ------------------------------------------------------------------------*/
106/* Microsoft C defines _MSC_VER */
107#ifdef _MSC_VER
108
109/* We want COMPILER to expand to a string containing _MSC_VER's *value*.
110 * This is horridly tricky, because the stringization operator only works
111 * on macro arguments, and doesn't evaluate macros passed *as* arguments.
112 * Attempts simpler than the following appear doomed to produce "_MSC_VER"
113 * literally in the string.
114 */
115#define _Py_PASTE_VERSION(SUFFIX) \
116 ("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]")
117/* e.g., this produces, after compile-time string catenation,
118 * ("[MSC v.1200 32 bit (Intel)]")
119 *
120 * _Py_STRINGIZE(_MSC_VER) expands to
121 * _Py_STRINGIZE1((_MSC_VER)) expands to
122 * _Py_STRINGIZE2(_MSC_VER) but as this call is the result of token-pasting
123 * it's scanned again for macros and so further expands to (under MSVC 6)
124 * _Py_STRINGIZE2(1200) which then expands to
125 * "1200"
126 */
127#define _Py_STRINGIZE(X) _Py_STRINGIZE1((X))
128#define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X
129#define _Py_STRINGIZE2(X) #X
130
131/* MSVC defines _WINxx to differentiate the windows platform types
132
133 Note that for compatibility reasons _WIN32 is defined on Win32
134 *and* on Win64. For the same reasons, in Python, MS_WIN32 is
135 defined on Win32 *and* Win64. Win32 only code must therefore be
136 guarded as follows:
137 #if defined(MS_WIN32) && !defined(MS_WIN64)
138 Some modules are disabled on Itanium processors, therefore we
139 have MS_WINI64 set for those targets, otherwise MS_WINX64
140*/
141#ifdef _WIN64
142#define MS_WIN64
143#endif
144
145/* set the COMPILER */
146#ifdef MS_WIN64
147#if defined(_M_IA64)
148#define COMPILER _Py_PASTE_VERSION("64 bit (Itanium)")
149#define MS_WINI64
150#elif defined(_M_X64) || defined(_M_AMD64)
151#define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)")
152#define MS_WINX64
153#else
154#define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)")
155#endif
156#endif /* MS_WIN64 */
157
158/* set the version macros for the windows headers */
159#ifdef MS_WINX64
160/* 64 bit only runs on XP or greater */
161#define Py_WINVER 0x0501 /* _WIN32_WINNT_WINXP */
162#define Py_NTDDI NTDDI_WINXP
163#else
164/* Python 2.6+ requires Windows 2000 or greater */
165#define Py_WINVER 0x0500 /* _WIN32_WINNT_WIN2K */
166#define Py_NTDDI NTDDI_WIN2KSP4
167#endif
168
169/* We only set these values when building Python - we don't want to force
170 these values on extensions, as that will affect the prototypes and
171 structures exposed in the Windows headers. Even when building Python, we
172 allow a single source file to override this - they may need access to
173 structures etc so it can optionally use new Windows features if it
174 determines at runtime they are available.
175*/
176#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_MODULE)
177#ifndef NTDDI_VERSION
178#define NTDDI_VERSION Py_NTDDI
179#endif
180#ifndef WINVER
181#define WINVER Py_WINVER
182#endif
183#ifndef _WIN32_WINNT
184#define _WIN32_WINNT Py_WINVER
185#endif
186#endif
187
188/* _W64 is not defined for VC6 or eVC4 */
189#ifndef _W64
190#define _W64
191#endif
192
193/* Define like size_t, omitting the "unsigned" */
194#ifdef MS_WIN64
195typedef __int64 ssize_t;
196#else
197typedef _W64 int ssize_t;
198#endif
199#define HAVE_SSIZE_T 1
200
201#if defined(MS_WIN32) && !defined(MS_WIN64)
202#ifdef _M_IX86
203#define COMPILER _Py_PASTE_VERSION("32 bit (Intel)")
204#else
205#define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)")
206#endif
207#endif /* MS_WIN32 && !MS_WIN64 */
208
209typedef int pid_t;
210
211#include <float.h>
212#define Py_IS_NAN _isnan
213#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))
214#define Py_IS_FINITE(X) _finite(X)
215#define copysign _copysign
216#define hypot _hypot
217
218/* Side by Side assemblies supported in VS 2005 and VS 2008 but not 2010*/
219#if _MSC_VER >= 1400 && _MSC_VER < 1600
220#define HAVE_SXS 1
221#endif
222
223/* define some ANSI types that are not defined in earlier Win headers */
224#if _MSC_VER >= 1200
225/* This file only exists in VC 6.0 or higher */
226#include <basetsd.h>
227#endif
228
229#endif /* _MSC_VER */
230
231/* ------------------------------------------------------------------------*/
232/* The Borland compiler defines __BORLANDC__ */
233/* XXX These defines are likely incomplete, but should be easy to fix. */
234#ifdef __BORLANDC__
235#define COMPILER "[Borland]"
236
237#ifdef _WIN32
238/* tested with BCC 5.5 (__BORLANDC__ >= 0x0550)
239 */
240
241typedef int pid_t;
242/* BCC55 seems to understand __declspec(dllimport), it is used in its
243 own header files (winnt.h, ...) - so we can do nothing and get the default*/
244
245#undef HAVE_SYS_UTIME_H
246#define HAVE_UTIME_H
247#define HAVE_DIRENT_H
248
249/* rename a few functions for the Borland compiler */
250#include <io.h>
251#define _chsize chsize
252#define _setmode setmode
253
254#else /* !_WIN32 */
255#error "Only Win32 and later are supported"
256#endif /* !_WIN32 */
257
258#endif /* BORLANDC */
259
260/* ------------------------------------------------------------------------*/
261/* egcs/gnu-win32 defines __GNUC__ and _WIN32 */
262#if defined(__GNUC__) && defined(_WIN32)
263/* XXX These defines are likely incomplete, but should be easy to fix.
264 They should be complete enough to build extension modules. */
265/* Suggested by Rene Liebscher <R.Liebscher@gmx.de> to avoid a GCC 2.91.*
266 bug that requires structure imports. More recent versions of the
267 compiler don't exhibit this bug.
268*/
269#if (__GNUC__==2) && (__GNUC_MINOR__<=91)
270#warning "Please use an up-to-date version of gcc! (>2.91 recommended)"
271#endif
272
273#define COMPILER "[gcc]"
274#define hypot _hypot
275#define PY_LONG_LONG long long
276#define PY_LLONG_MIN LLONG_MIN
277#define PY_LLONG_MAX LLONG_MAX
278#define PY_ULLONG_MAX ULLONG_MAX
279#endif /* GNUC */
280
281/* ------------------------------------------------------------------------*/
282/* lcc-win32 defines __LCC__ */
283#if defined(__LCC__)
284/* XXX These defines are likely incomplete, but should be easy to fix.
285 They should be complete enough to build extension modules. */
286
287#define COMPILER "[lcc-win32]"
288typedef int pid_t;
289/* __declspec() is supported here too - do nothing to get the defaults */
290
291#endif /* LCC */
292
293/* ------------------------------------------------------------------------*/
294/* End of compilers - finish up */
295
296#ifndef NO_STDIO_H
297# include <stdio.h>
298#endif
299
300/* 64 bit ints are usually spelt __int64 unless compiler has overridden */
301#define HAVE_LONG_LONG 1
302#ifndef PY_LONG_LONG
303# define PY_LONG_LONG __int64
304# define PY_LLONG_MAX _I64_MAX
305# define PY_LLONG_MIN _I64_MIN
306# define PY_ULLONG_MAX _UI64_MAX
307#endif
308
309/* For Windows the Python core is in a DLL by default. Test
310Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
311#if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED)
312# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
313# define MS_COREDLL /* deprecated old symbol */
314#endif /* !MS_NO_COREDLL && ... */
315
316/* All windows compilers that use this header support __declspec */
317#define HAVE_DECLSPEC_DLL
318
319/* For an MSVC DLL, we can nominate the .lib files used by extensions */
320#ifdef MS_COREDLL
321# ifndef Py_BUILD_CORE /* not building the core - must be an ext */
322# if defined(_MSC_VER)
323 /* So MSVC users need not specify the .lib file in
324 their Makefile (other compilers are generally
325 taken care of by distutils.) */
326# if defined(_DEBUG)
327# pragma comment(lib,"python33.lib")
328# elif defined(Py_LIMITED_API)
329# pragma comment(lib,"python3.lib")
330# else
331# pragma comment(lib,"python33.lib")
332# endif /* _DEBUG */
333# endif /* _MSC_VER */
334# endif /* Py_BUILD_CORE */
335#endif /* MS_COREDLL */
336
337#if defined(MS_WIN64)
338/* maintain "win32" sys.platform for backward compatibility of Python code,
339 the Win64 API should be close enough to the Win32 API to make this
340 preferable */
341# define PLATFORM "win32"
342# define SIZEOF_VOID_P 8
343# define SIZEOF_TIME_T 8
344# define SIZEOF_OFF_T 4
345# define SIZEOF_FPOS_T 8
346# define SIZEOF_HKEY 8
347# define SIZEOF_SIZE_T 8
348/* configure.ac defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG,
349 sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t).
350 On Win64 the second condition is not true, but if fpos_t replaces off_t
351 then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64
352 should define this. */
353# define HAVE_LARGEFILE_SUPPORT
354#elif defined(MS_WIN32)
355# define PLATFORM "win32"
356# define HAVE_LARGEFILE_SUPPORT
357# define SIZEOF_VOID_P 4
358# define SIZEOF_OFF_T 4
359# define SIZEOF_FPOS_T 8
360# define SIZEOF_HKEY 4
361# define SIZEOF_SIZE_T 4
362 /* MS VS2005 changes time_t to an 64-bit type on all platforms */
363# if defined(_MSC_VER) && _MSC_VER >= 1400
364# define SIZEOF_TIME_T 8
365# else
366# define SIZEOF_TIME_T 4
367# endif
368#endif
369
370#ifdef _DEBUG
371//# define Py_DEBUG
372#endif
373
374
375#ifdef MS_WIN32
376
377#define SIZEOF_SHORT 2
378#define SIZEOF_INT 4
379#define SIZEOF_LONG 4
380#define SIZEOF_LONG_LONG 8
381#define SIZEOF_DOUBLE 8
382#define SIZEOF_FLOAT 4
383
384/* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200.
385 Microsoft eMbedded Visual C++ 4.0 has a version number of 1201 and doesn't
386 define these.
387 If some compiler does not provide them, modify the #if appropriately. */
388#if defined(_MSC_VER)
389#if _MSC_VER > 1300
390#define HAVE_UINTPTR_T 1
391#define HAVE_INTPTR_T 1
392#else
393/* VC6, VS 2002 and eVC4 don't support the C99 LL suffix for 64-bit integer literals */
394#define Py_LL(x) x##I64
395#endif /* _MSC_VER > 1200 */
396#endif /* _MSC_VER */
397
398#endif
399
400/* define signed and unsigned exact-width 32-bit and 64-bit types, used in the
401 implementation of Python long integers. */
402#ifndef PY_UINT32_T
403#if SIZEOF_INT == 4
404#define HAVE_UINT32_T 1
405#define PY_UINT32_T unsigned int
406#elif SIZEOF_LONG == 4
407#define HAVE_UINT32_T 1
408#define PY_UINT32_T unsigned long
409#endif
410#endif
411
412#ifndef PY_UINT64_T
413#if SIZEOF_LONG_LONG == 8
414#define HAVE_UINT64_T 1
415#define PY_UINT64_T unsigned PY_LONG_LONG
416#endif
417#endif
418
419#ifndef PY_INT32_T
420#if SIZEOF_INT == 4
421#define HAVE_INT32_T 1
422#define PY_INT32_T int
423#elif SIZEOF_LONG == 4
424#define HAVE_INT32_T 1
425#define PY_INT32_T long
426#endif
427#endif
428
429#ifndef PY_INT64_T
430#if SIZEOF_LONG_LONG == 8
431#define HAVE_INT64_T 1
432#define PY_INT64_T PY_LONG_LONG
433#endif
434#endif
435
436/* Fairly standard from here! */
437
438/* Define to 1 if you have the `copysign' function. */
439#define HAVE_COPYSIGN 1
440
441/* Define to 1 if you have the `isinf' macro. */
442#define HAVE_DECL_ISINF 1
443
444/* Define to 1 if you have the `isnan' function. */
445#define HAVE_DECL_ISNAN 1
446
447/* Define if on AIX 3.
448 System headers sometimes define this.
449 We just want to avoid a redefinition error message. */
450#ifndef _ALL_SOURCE
451/* #undef _ALL_SOURCE */
452#endif
453
454/* Define to empty if the keyword does not work. */
455/* #define const */
456
457/* Define to 1 if you have the <conio.h> header file. */
458#ifndef MS_WINCE
459#define HAVE_CONIO_H 1
460#endif
461
462/* Define to 1 if you have the <direct.h> header file. */
463#ifndef MS_WINCE
464#define HAVE_DIRECT_H 1
465#endif
466
467/* Define if you have dirent.h. */
468/* #define DIRENT 1 */
469
470/* Define to the type of elements in the array set by `getgroups'.
471 Usually this is either `int' or `gid_t'. */
472/* #undef GETGROUPS_T */
473
474/* Define to `int' if <sys/types.h> doesn't define. */
475/* #undef gid_t */
476
477/* Define if your struct tm has tm_zone. */
478/* #undef HAVE_TM_ZONE */
479
480/* Define if you don't have tm_zone but do have the external array
481 tzname. */
482#define HAVE_TZNAME
483
484/* Define to `int' if <sys/types.h> doesn't define. */
485/* #undef mode_t */
486
487/* Define if you don't have dirent.h, but have ndir.h. */
488/* #undef NDIR */
489
490/* Define to `long' if <sys/types.h> doesn't define. */
491/* #undef off_t */
492
493/* Define to `int' if <sys/types.h> doesn't define. */
494/* #undef pid_t */
495
496/* Define if the system does not provide POSIX.1 features except
497 with this defined. */
498/* #undef _POSIX_1_SOURCE */
499
500/* Define if you need to in order for stat and other things to work. */
501/* #undef _POSIX_SOURCE */
502
503/* Define as the return type of signal handlers (int or void). */
504#define RETSIGTYPE void
505
506/* Define to `unsigned' if <sys/types.h> doesn't define. */
507/* #undef size_t */
508
509/* Define if you have the ANSI C header files. */
510#define STDC_HEADERS 1
511
512/* Define if you don't have dirent.h, but have sys/dir.h. */
513/* #undef SYSDIR */
514
515/* Define if you don't have dirent.h, but have sys/ndir.h. */
516/* #undef SYSNDIR */
517
518/* Define if you can safely include both <sys/time.h> and <time.h>. */
519/* #undef TIME_WITH_SYS_TIME */
520
521/* Define if your <sys/time.h> declares struct tm. */
522/* #define TM_IN_SYS_TIME 1 */
523
524/* Define to `int' if <sys/types.h> doesn't define. */
525/* #undef uid_t */
526
527/* Define if the closedir function returns void instead of int. */
528/* #undef VOID_CLOSEDIR */
529
530/* Define if getpgrp() must be called as getpgrp(0)
531 and (consequently) setpgrp() as setpgrp(0, 0). */
532/* #undef GETPGRP_HAVE_ARGS */
533
534/* Define this if your time.h defines altzone */
535/* #define HAVE_ALTZONE */
536
537/* Define if you have the putenv function. */
538#ifndef MS_WINCE
539#define HAVE_PUTENV
540#endif
541
542/* Define if your compiler supports function prototypes */
543#define HAVE_PROTOTYPES
544
545/* Define if you can safely include both <sys/select.h> and <sys/time.h>
546 (which you can't on SCO ODT 3.0). */
547/* #undef SYS_SELECT_WITH_SYS_TIME */
548
549/* Define if you want documentation strings in extension modules */
550#define WITH_DOC_STRINGS 1
551
552/* Define if you want to compile in rudimentary thread support */
553/* #undef WITH_THREAD */
554
555/* Define if you want to use the GNU readline library */
556/* #define WITH_READLINE 1 */
557
558/* Use Python's own small-block memory-allocator. */
559#define WITH_PYMALLOC 1
560
561/* Define if you have clock. */
562/* #define HAVE_CLOCK */
563
564/* Define when any dynamic module loading is enabled */
565#define HAVE_DYNAMIC_LOADING
566
567/* Define if you have ftime. */
568#ifndef MS_WINCE
569#define HAVE_FTIME
570#endif
571
572/* Define if you have getpeername. */
573#define HAVE_GETPEERNAME
574
575/* Define if you have getpgrp. */
576/* #undef HAVE_GETPGRP */
577
578/* Define if you have getpid. */
579#ifndef MS_WINCE
580#define HAVE_GETPID
581#endif
582
583/* Define if you have gettimeofday. */
584/* #undef HAVE_GETTIMEOFDAY */
585
586/* Define if you have getwd. */
587/* #undef HAVE_GETWD */
588
589/* Define if you have lstat. */
590/* #undef HAVE_LSTAT */
591
592/* Define if you have the mktime function. */
593#define HAVE_MKTIME
594
595/* Define if you have nice. */
596/* #undef HAVE_NICE */
597
598/* Define if you have readlink. */
599/* #undef HAVE_READLINK */
600
601/* Define if you have select. */
602/* #undef HAVE_SELECT */
603
604/* Define if you have setpgid. */
605/* #undef HAVE_SETPGID */
606
607/* Define if you have setpgrp. */
608/* #undef HAVE_SETPGRP */
609
610/* Define if you have setsid. */
611/* #undef HAVE_SETSID */
612
613/* Define if you have setvbuf. */
614#define HAVE_SETVBUF
615
616/* Define if you have siginterrupt. */
617/* #undef HAVE_SIGINTERRUPT */
618
619/* Define if you have symlink. */
620/* #undef HAVE_SYMLINK */
621
622/* Define if you have tcgetpgrp. */
623/* #undef HAVE_TCGETPGRP */
624
625/* Define if you have tcsetpgrp. */
626/* #undef HAVE_TCSETPGRP */
627
628/* Define if you have times. */
629/* #undef HAVE_TIMES */
630
631/* Define if you have uname. */
632/* #undef HAVE_UNAME */
633
634/* Define if you have waitpid. */
635/* #undef HAVE_WAITPID */
636
637/* Define to 1 if you have the `wcsftime' function. */
638#if defined(_MSC_VER) && _MSC_VER >= 1310
639#define HAVE_WCSFTIME 1
640#endif
641
642/* Define to 1 if you have the `wcscoll' function. */
643#ifndef MS_WINCE
644#define HAVE_WCSCOLL 1
645#endif
646
647/* Define to 1 if you have the `wcsxfrm' function. */
648#ifndef MS_WINCE
649#define HAVE_WCSXFRM 1
650#endif
651
652/* Define if the zlib library has inflateCopy */
653#define HAVE_ZLIB_COPY 1
654
655/* Define if you have the <dlfcn.h> header file. */
656/* #undef HAVE_DLFCN_H */
657
658/* Define to 1 if you have the <errno.h> header file. */
659#ifndef MS_WINCE
660#define HAVE_ERRNO_H 1
661#endif
662
663/* Define if you have the <fcntl.h> header file. */
664#ifndef MS_WINCE
665#define HAVE_FCNTL_H 1
666#endif
667
668/* Define to 1 if you have the <process.h> header file. */
669#ifndef MS_WINCE
670#define HAVE_PROCESS_H 1
671#endif
672
673/* Define to 1 if you have the <signal.h> header file. */
674#ifndef MS_WINCE
675#define HAVE_SIGNAL_H 1
676#endif
677
678/* Define if you have the <stdarg.h> prototypes. */
679#define HAVE_STDARG_PROTOTYPES
680
681/* Define if you have the <stddef.h> header file. */
682#define HAVE_STDDEF_H 1
683
684/* Define if you have the <sys/audioio.h> header file. */
685/* #undef HAVE_SYS_AUDIOIO_H */
686
687/* Define if you have the <sys/param.h> header file. */
688/* #define HAVE_SYS_PARAM_H 1 */
689
690/* Define if you have the <sys/select.h> header file. */
691/* #define HAVE_SYS_SELECT_H 1 */
692
693/* Define to 1 if you have the <sys/stat.h> header file. */
694#ifndef MS_WINCE
695#define HAVE_SYS_STAT_H 1
696#endif
697
698/* Define if you have the <sys/time.h> header file. */
699/* #define HAVE_SYS_TIME_H 1 */
700
701/* Define if you have the <sys/times.h> header file. */
702/* #define HAVE_SYS_TIMES_H 1 */
703
704/* Define to 1 if you have the <sys/types.h> header file. */
705#ifndef MS_WINCE
706#define HAVE_SYS_TYPES_H 1
707#endif
708
709/* Define if you have the <sys/un.h> header file. */
710/* #define HAVE_SYS_UN_H 1 */
711
712/* Define if you have the <sys/utime.h> header file. */
713/* #define HAVE_SYS_UTIME_H 1 */
714
715/* Define if you have the <sys/utsname.h> header file. */
716/* #define HAVE_SYS_UTSNAME_H 1 */
717
718/* Define if you have the <unistd.h> header file. */
719/* #define HAVE_UNISTD_H 1 */
720
721/* Define if you have the <utime.h> header file. */
722/* #define HAVE_UTIME_H 1 */
723
724/* Define if the compiler provides a wchar.h header file. */
725#define HAVE_WCHAR_H 1
726
727/* The size of `wchar_t', as computed by sizeof. */
728#define SIZEOF_WCHAR_T 2
729
730/* Define if you have the dl library (-ldl). */
731/* #undef HAVE_LIBDL */
732
733/* Define if you have the mpc library (-lmpc). */
734/* #undef HAVE_LIBMPC */
735
736/* Define if you have the nsl library (-lnsl). */
737#define HAVE_LIBNSL 1
738
739/* Define if you have the seq library (-lseq). */
740/* #undef HAVE_LIBSEQ */
741
742/* Define if you have the socket library (-lsocket). */
743#define HAVE_LIBSOCKET 1
744
745/* Define if you have the sun library (-lsun). */
746/* #undef HAVE_LIBSUN */
747
748/* Define if you have the termcap library (-ltermcap). */
749/* #undef HAVE_LIBTERMCAP */
750
751/* Define if you have the termlib library (-ltermlib). */
752/* #undef HAVE_LIBTERMLIB */
753
754/* Define if you have the thread library (-lthread). */
755/* #undef HAVE_LIBTHREAD */
756
757/* WinSock does not use a bitmask in select, and uses
758 socket handles greater than FD_SETSIZE */
759#define Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE
760
761/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
762 least significant byte first */
763#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
764
765#endif /* !Py_CONFIG_H */
7660
=== removed file 'win_fix/readme.txt'
--- win_fix/readme.txt 2014-01-20 14:29:21 +0000
+++ win_fix/readme.txt 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
1The Python distro does not come packaged with the debug
2library: "pythonXX_d.lib". So, in order to get ECS:Python
3to compile in Debug mode:
4
5copy: "DEBUG Fix\PythonXX\pyconfig.h"
6to: "PYTHON_ROOT\include\"
7\ No newline at end of file0\ No newline at end of file

Subscribers

People subscribed via source and target branches

to all changes: