[evolution-data-server] Removing some pthreads related comments.



commit a78b5d47b5d36f9308d83747c0d72423d3e933a8
Author: Fridrich Å trba <fridrich strba bluewin ch>
Date:   Fri Apr 16 01:07:18 2010 +0200

    Removing some pthreads related comments.

 calendar/backends/weather/e-weather-source-ccf.c |    5 ++---
 calendar/libecal/e-cal-time-util.c               |    6 +++---
 camel/camel-mime-message.c                       |    5 ++---
 camel/camel-mime-utils.c                         |    5 ++---
 camel/camel-tcp-stream-raw.c                     |    6 +++++-
 libedataserver/e-time-utils.c                    |    7 ++++---
 6 files changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/calendar/backends/weather/e-weather-source-ccf.c b/calendar/backends/weather/e-weather-source-ccf.c
index 2400f16..a9b6ba1 100644
--- a/calendar/backends/weather/e-weather-source-ccf.c
+++ b/calendar/backends/weather/e-weather-source-ccf.c
@@ -39,10 +39,9 @@
 
 #include "libedataserver/e-data-server-util.h"
 
-/* The localtime_r() in <pthread.h> doesn't guard against localtime()
- * returning NULL
- */
+#ifdef localtime_r
 #undef localtime_r
+#endif
 
 /* The localtime() in Microsoft's C library is MT-safe */
 #define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
diff --git a/calendar/libecal/e-cal-time-util.c b/calendar/libecal/e-cal-time-util.c
index 5be06f3..9bd4c1c 100644
--- a/calendar/libecal/e-cal-time-util.c
+++ b/calendar/libecal/e-cal-time-util.c
@@ -14,10 +14,10 @@
 
 
 #ifdef G_OS_WIN32
-/* The gmtime_r() definition in pthreads-win32's pthread.h doesn't
- * guard against gmtime() returning NULL.
- */
+#ifdef gmtime_r
 #undef gmtime_r
+#endif
+
 /* The gmtime() in Microsoft's C library is MT-safe */
 #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
 #endif
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index d09279c..e3a4bcb 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -46,10 +46,9 @@
 #include "camel-url.h"
 
 #ifdef G_OS_WIN32
-/* Undef the similar macro from pthread.h, it doesn't check if
- * gmtime() returns NULL.
- */
+#ifdef gmtime_r
 #undef gmtime_r
+#endif
 
 /* The gmtime() in Microsoft's C library is MT-safe */
 #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 48ac641..8974e51 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -55,10 +55,9 @@
 #include "camel-utf8.h"
 
 #ifdef G_OS_WIN32
-/* Undef the similar macro from pthread.h, it doesn't check if
- * gmtime() returns NULL.
- */
+#ifdef gmtime_r
 #undef gmtime_r
+#endif
 
 /* The gmtime() in Microsoft's C library is MT-safe */
 #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index 095c4b6..a833d74 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -48,8 +48,12 @@
 #define SOCKET_CLOSE(fd) closesocket (fd)
 #define SOCKET_ERROR_IS_EINPROGRESS() (WSAGetLastError () == WSAEWOULDBLOCK)
 #define SOCKET_ERROR_IS_EINTR() 0 /* No WSAEINTR in WinSock2 */
-#undef ETIMEDOUT		/* In case pthreads-win32's <pthread.h> bogusly defined it */
+
+#ifdef ETIMEDOUT
+#undef ETIMEDOUT
+#endif
 #define ETIMEDOUT EAGAIN
+
 #endif
 
 static CamelTcpStreamClass *parent_class = NULL;
diff --git a/libedataserver/e-time-utils.c b/libedataserver/e-time-utils.c
index eddb03a..07e89e2 100644
--- a/libedataserver/e-time-utils.c
+++ b/libedataserver/e-time-utils.c
@@ -29,12 +29,13 @@
 #include "e-data-server-util.h"
 
 #ifdef G_OS_WIN32
-/* The localtime_r() definition in pthreads-win32's pthread.h doesn't guard
- * against localtime() returning NULL.
- */
+#ifdef localtime_r
 #undef localtime_r
+#endif
+
 /* The localtime() in Microsoft's C library is MT-safe */
 #define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
+#endif
 
 #include <windows.h>
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]