common: Fix build problem with Sun Studio compiler.
authorWerner Koch <wk@gnupg.org>
Fri, 15 Nov 2013 08:08:58 +0000 (09:08 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 7 Mar 2014 09:55:53 +0000 (10:55 +0100)
* common/estream.c (ESTREAM_MUTEX_UNLOCK): Use int dummy dummy
functions.
(ESTREAM_MUTEX_INITIALIZE): Ditto.
--

GnuPG-bug-id: 1566
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 571bcd4662a351cfa55bbf1a79ed1bc26da5780f)

Reolved conflicts:
common/estream.c

Warning: estream.c still uses pth_mutex_* which is definitely wrong.
         Needs to be investigated.

common/estream.c

index 79e3efb..9c15100 100644 (file)
@@ -171,7 +171,8 @@ typedef pth_mutex_t estream_mutex_t;
   ((pth_mutex_acquire (&(mutex), 1, NULL) == TRUE) ? 0 : -1)
 # define ESTREAM_MUTEX_INITIALIZE(mutex)  \
   pth_mutex_init    (&(mutex))
-#else
+
+#else /*!HAVE_NPTH*/
 
 typedef void *estream_mutex_t;
 
@@ -190,10 +191,11 @@ dummy_mutex_call_int (estream_mutex_t mutex)
 
 # define ESTREAM_MUTEX_INITIALIZER NULL
 # define ESTREAM_MUTEX_LOCK(mutex) dummy_mutex_call_void ((mutex))
-# define ESTREAM_MUTEX_UNLOCK(mutex) dummy_mutex_call_void ((mutex))
+# define ESTREAM_MUTEX_UNLOCK(mutex) dummy_mutex_call_int ((mutex))
 # define ESTREAM_MUTEX_TRYLOCK(mutex) dummy_mutex_call_int ((mutex))
-# define ESTREAM_MUTEX_INITIALIZE(mutex) dummy_mutex_call_void ((mutex))
-#endif
+# define ESTREAM_MUTEX_INITIALIZE(mutex) dummy_mutex_call_int ((mutex))
+
+#endif /*!HAVE_NPTH*/
 
 /* Primitive system I/O.  */