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

Robert Watson robert at fledge.watson.org
Fri Nov 13 06:37:19 PST 2009


On Sat, 7 Nov 2009, Joakim Johansson wrote:

> 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); \
> 	}	\
> })

Possibly we should cast to uintptr_t?  Or maybe we should do the cast in 
_dispatch_thread_self() so that, internal to GCD, thread IDs are always 
treated as pointers.

Robert

>
> -
> 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
>
> _______________________________________________
> 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