make source compile under MinGW32

todo: link against OpenGL GLU/GLUT.
This commit is contained in:
ejcoumans
2008-01-30 01:09:01 +00:00
parent 97e96c243b
commit 5c40e615bd
7 changed files with 21 additions and 11 deletions

View File

@@ -254,7 +254,7 @@ int maxNumOutstandingTasks = 4;
#ifdef USE_WIN32_THREADING
m_threadSupportCollision = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo(
m_threadSupportCollision = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo(
"collision",
processCollisionTask,
createCollisionLocalStoreMemory,

View File

@@ -12,6 +12,8 @@ typedef union
void *p;
} addr64;
#define USE_WIN32_THREADING 1
#if defined(__MINGW32__) || defined(__CYGWIN__) || (defined (_MSC_VER) && _MSC_VER < 1300)
#else
#endif //__MINGW32__
@@ -26,7 +28,7 @@ typedef union
#include <string.h> //memcpy
#define USE_WIN32_THREADING 1
#include <stdio.h>
#define spu_printf printf

View File

@@ -17,17 +17,20 @@ subject to the following restrictions:
#ifdef USE_WIN32_THREADING
#include <windows.h>
#include "SpuCollisionTaskProcess.h"
#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
#include <Windows.h>
///The number of threads should be equal to the number of available cores
///Todo: each worker should be linked to a single core, using SetThreadIdealProcessor.
///Win32ThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
///Setup and initialize SPU/CELL/Libspe2
Win32ThreadSupport::Win32ThreadSupport(Win32ThreadConstructionInfo& threadConstructionInfo)
Win32ThreadSupport::Win32ThreadSupport(const Win32ThreadConstructionInfo & threadConstructionInfo)
{
startThreads(threadConstructionInfo);
}
@@ -173,7 +176,7 @@ void Win32ThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned in
void Win32ThreadSupport::startThreads(Win32ThreadConstructionInfo& threadConstructionInfo)
void Win32ThreadSupport::startThreads(const Win32ThreadConstructionInfo& threadConstructionInfo)
{
m_activeSpuStatus.resize(threadConstructionInfo.m_numThreads);

View File

@@ -67,8 +67,6 @@ private:
public:
///Setup and initialize SPU/CELL/Libspe2
struct Win32ThreadConstructionInfo
{
Win32ThreadConstructionInfo(char* uniqueName,
@@ -94,12 +92,14 @@ public:
};
Win32ThreadSupport(Win32ThreadConstructionInfo& threadConstructionInfo);
Win32ThreadSupport(const Win32ThreadConstructionInfo& threadConstructionInfo);
///cleanup/shutdown Libspe2
virtual ~Win32ThreadSupport();
void startThreads(Win32ThreadConstructionInfo& threadInfo);
void startThreads(const Win32ThreadConstructionInfo& threadInfo);
///send messages to SPUs

View File

@@ -225,7 +225,7 @@ void
daeMetaElement::validate()
{
if (_createFunc == NULL)
_createFunc = DAECreateElement;
_createFunc = (daeElementConstructFunctionPtr) DAECreateElement;
if (_elementSize == 0)
{
daeInt place=0;

View File

@@ -190,6 +190,7 @@ xmlModuleFree(xmlModulePtr module)
return (0);
}
#if 0
#ifdef HAVE_DLOPEN
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
@@ -287,6 +288,7 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
#endif /* HAVE_SHLLOAD */
#endif /* ! HAVE_DLOPEN */
#endif //0
#ifdef _WIN32

View File

@@ -40,7 +40,10 @@
# endif
/* XXX This is from Win32's <ctype.h> */
# ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
/* MinGW32 chokes on the next line */
#ifndef __MINGW32__
typedef unsigned short int wchar_t;
#endif //__MINGW32__
# define _WCHAR_T_DEFINED
# endif
# endif