diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2005-12-06 21:54:32 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2005-12-06 21:54:32 +0000 |
commit | 3118cea037b63661e5f7ebff0c1a810da7f6159b (patch) | |
tree | 87acee46f072dcf73f0dda6bcbfe6627e7be1b51 | |
parent | f25cb430026b01219984364bb991948418909b77 (diff) |
fixes for pthreads version 2
fixes for pthreads V2
svn path=/trunk/; revision=4156
-rw-r--r-- | externals/grill/py/py.vcproj | 6 | ||||
-rw-r--r-- | externals/grill/py/source/pybase.cpp | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/externals/grill/py/py.vcproj b/externals/grill/py/py.vcproj index 5ad7f1bf..50d989c8 100644 --- a/externals/grill/py/py.vcproj +++ b/externals/grill/py/py.vcproj @@ -85,7 +85,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="c:\programme\audio\pd-0.39-1\src;..\flext\source;c:\programme\prog\Python24\include" + AdditionalIncludeDirectories="C:\data\prog\packs\pthreads\include;c:\programme\audio\pd\src;..\flext\source;c:\programme\prog\Python24\include" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PY_EXPORTS;FLEXT_SYS=2;FLEXT_THREADS;PY_NUMARRAY" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -101,11 +101,11 @@ Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" - AdditionalDependencies="pd.lib pthreadVC.lib" + AdditionalDependencies="pd.lib pthreadVC2.lib" OutputFile="$(outdir)/py.dll" LinkIncremental="1" SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories=""C:\data\prog\packs\Python-2.4\PCbuild";"c:/programme/audio/pd-0.39-1/bin"" + AdditionalLibraryDirectories=""C:\data\prog\packs\Python-2.4\PCbuild";C:\data\prog\packs\pthreads\lib;c:/programme/audio/pd/bin" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(outdir)/py.pdb" SubSystem="2" diff --git a/externals/grill/py/source/pybase.cpp b/externals/grill/py/source/pybase.cpp index e68d9929..bdc76099 100644 --- a/externals/grill/py/source/pybase.cpp +++ b/externals/grill/py/source/pybase.cpp @@ -27,7 +27,19 @@ static PyObject *gcollect = NULL; #ifdef FLEXT_THREADS
-typedef std::map<flext::thrid_t,PyThreadState *> PyThrMap;
+class ThrCmp
+{
+public:
+ inline bool operator()(const flext::thrid_t &a,const flext::thrid_t &b) const
+ {
+ if(sizeof(a) == sizeof(size_t))
+ return *(size_t *)&a < *(size_t *)&b;
+ else
+ return memcmp(&a,&b,sizeof(a)) < 0;
+ }
+};
+
+typedef std::map<flext::thrid_t,PyThreadState *,ThrCmp> PyThrMap;
static PyInterpreterState *pymain = NULL;
static PyThrMap pythrmap;
|