Author: wyoung
Date: Thu Oct 25 14:42:11 2007
New Revision: 1783

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1783&view=rev
Log:
Fixed some MSVC incompatibilities in new BeecryptMutex, based on a patch
by Jim Wallace <[EMAIL PROTECTED]>

Modified:
    trunk/lib/beemutex.cpp

Modified: trunk/lib/beemutex.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/beemutex.cpp?rev=1783&r1=1782&r2=1783&view=diff
==============================================================================
--- trunk/lib/beemutex.cpp (original)
+++ trunk/lib/beemutex.cpp Thu Oct 25 14:42:11 2007
@@ -62,8 +62,9 @@
        : pmutex_(new bc_mutex_t)
 #endif
 {
-#if MYSQLPP_PLATFORM_WINDOWS
-       impl_val(pmutex_) = CreateMutex((LPSECURITY_ATTRIBUTES) 0, FALSE, 
(LPCSTR) 0);
+#if defined(MYSQLPP_PLATFORM_WINDOWS)
+       *impl_ptr(pmutex_) = CreateMutex((LPSECURITY_ATTRIBUTES) 0, FALSE,
+                       (LPCSTR) 0);
        if (!impl_val(pmutex_))
                throw MutexFailed("CreateMutex failed");
 #else
@@ -82,7 +83,7 @@
 BeecryptMutex::~BeecryptMutex()
 {
 #if defined(ACTUALLY_DOES_SOMETHING)
-#      if MYSQLPP_PLATFORM_WINDOWS
+#      if defined(MYSQLPP_PLATFORM_WINDOWS)
                CloseHandle(impl_val(pmutex_));
 #      elif HAVE_SYNCH_H
                mutex_destroy(impl_ptr(pmutex_));
@@ -98,7 +99,7 @@
 void
 BeecryptMutex::lock() throw (MutexFailed)
 {
-#if MYSQLPP_PLATFORM_WINDOWS
+#if defined(MYSQLPP_PLATFORM_WINDOWS)
        if (WaitForSingleObject(impl_val(pmutex_), INFINITE) == WAIT_OBJECT_0)
                return;
        throw MutexFailed("WaitForSingleObject failed");
@@ -119,7 +120,7 @@
 BeecryptMutex::trylock() throw (MutexFailed)
 {
 #if defined(ACTUALLY_DOES_SOMETHING)
-#      if MYSQLPP_PLATFORM_WINDOWS
+#      if defined(MYSQLPP_PLATFORM_WINDOWS)
                switch (WaitForSingleObject(impl_val(pmutex_), 0)) {
                        case WAIT_TIMEOUT:
                                return false;
@@ -153,7 +154,7 @@
 void
 BeecryptMutex::unlock() throw (MutexFailed)
 {
-#if MYSQLPP_PLATFORM_WINDOWS
+#if defined(MYSQLPP_PLATFORM_WINDOWS)
        if (!ReleaseMutex(impl_val(pmutex_)))
                throw MutexFailed("ReleaseMutex failed");
 #else


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to