mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
* 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:
parent
64ae03d661
commit
34bfd4a349
@ -28,6 +28,61 @@ public:
|
|||||||
|
|
||||||
#ifdef _MSC_VER
|
#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
|
class NgMutex
|
||||||
{
|
{
|
||||||
CCriticalSection cs;
|
CCriticalSection cs;
|
||||||
@ -68,6 +123,8 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // MSVC_EXPRESS
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,17 +62,23 @@ namespace metis { extern "C" {
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# ifndef NO_PARALLEL_THREADS
|
# ifndef NO_PARALLEL_THREADS
|
||||||
# include <afxwin.h>
|
# ifdef MSVC_EXPRESS
|
||||||
# include <afxmt.h>
|
# include <pthread.h>
|
||||||
|
# else
|
||||||
|
# include <afxwin.h>
|
||||||
|
# include <afxmt.h>
|
||||||
|
# endif // MSVC_EXPRESS
|
||||||
# endif
|
# endif
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# undef WIN32_LEAN_AND_MEAN
|
# undef WIN32_LEAN_AND_MEAN
|
||||||
# include <winnt.h>
|
# include <winnt.h>
|
||||||
|
|
||||||
#else
|
#else // Not using MC VC++
|
||||||
|
|
||||||
# ifndef NO_PARALLEL_THREADS
|
# ifndef NO_PARALLEL_THREADS
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
530
ng/ngpkg.cpp
530
ng/ngpkg.cpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user