* Added a new Compiler Switch (MSVC_EXPRESS) to enable Netgen to be compiled using the Express Editions of Microsoft Visual C++

This commit is contained in:
Philippose Rajan 2009-01-30 22:12:17 +00:00
parent 64ae03d661
commit 34bfd4a349
3 changed files with 395 additions and 206 deletions

View File

@ -28,6 +28,61 @@ public:
#ifdef _MSC_VER
#ifdef MSVC_EXPRESS
// #include <pthread.h>
class NgMutex
{
pthread_mutex_t mut;
public:
NgMutex ()
{
pthread_mutex_init (&mut, NULL);
}
friend class NgLock;
};
class NgLock
{
pthread_mutex_t & mut;
bool locked;
public:
NgLock (NgMutex & ngmut, bool lock = false)
: mut (ngmut.mut)
{
if (lock)
pthread_mutex_lock (&mut);
locked = lock;
};
~NgLock()
{
if (locked)
pthread_mutex_unlock (&mut);
}
void Lock ()
{
pthread_mutex_lock (&mut);
locked = true;
}
void UnLock ()
{
pthread_mutex_unlock (&mut);
locked = false;
}
/*
int TryLock ()
{
return pthread_mutex_trylock (&mut);
}
*/
};
#else // Using MS VC++ Standard / Enterprise / Professional edition...
class NgMutex
{
CCriticalSection cs;
@ -68,6 +123,8 @@ public:
}
};
#endif // MSVC_EXPRESS
#else

View File

@ -62,17 +62,23 @@ namespace metis { extern "C" {
#ifdef _MSC_VER
# define WIN32_LEAN_AND_MEAN
# ifndef NO_PARALLEL_THREADS
# include <afxwin.h>
# include <afxmt.h>
# ifdef MSVC_EXPRESS
# include <pthread.h>
# else
# include <afxwin.h>
# include <afxmt.h>
# endif // MSVC_EXPRESS
# endif
# include <windows.h>
# undef WIN32_LEAN_AND_MEAN
# include <winnt.h>
#else
#else // Not using MC VC++
# ifndef NO_PARALLEL_THREADS
# include <pthread.h>
# endif
# endif
#endif

File diff suppressed because it is too large Load Diff