[libdispatch-dev] Solaris portability, dispatch.h - PATCH [6/6] REVISED

Joakim Johansson jocke at tbricks.com
Sat Nov 7 01:25:50 PST 2009


Thanks!

Revised patch attached.

Joakim

-----
 > svn diff internal.h
Index: internal.h
===================================================================
--- internal.h	(revision 142)
+++ internal.h	(working copy)
@@ -229,11 +235,10 @@
  ({	\
  	if (DISPATCH_DEBUG) {	\
  		_dispatch_log("libdispatch: %u\t%p\t" x, __LINE__,	\
-		    (void *)_dispatch_thread_self(), ##args);	\
+			(void *)(long)_dispatch_thread_self(), ##args); \
  	}	\
  })

-
  uint64_t _dispatch_get_nanoseconds(void);

  #ifndef DISPATCH_NO_LEGACY


On 6 nov 2009, at 19.52, Paolo Bonzini wrote:

> On 11/06/2009 04:01 PM, Joakim Johansson wrote:
>> There is a type mismatch here agin, pthread_t is not a pointer on
>> Solaris, but an unsigned int, so we need a different formatting  
>> string.
>> We also need to include additional headers.
>
> There is already a cast:
>
>> (void *)_dispatch_thread_self(), ##args); \
>
> so the _dispatch_debug definition should be okay for Solaris too.   
> If you have a warning, change it to (void*)(long) 
> _dispatch_thread_self().
>
> Paolo
> _______________________________________________
> libdispatch-dev mailing list
> libdispatch-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/libdispatch-dev




More information about the libdispatch-dev mailing list