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

Robert Watson robert at fledge.watson.org
Fri Nov 6 14:29:14 PST 2009


On Fri, 6 Nov 2009, Joakim Johansson wrote:

> Added the checking for cdefs.h that does not exist on all platforms, also 
> added the __BEGIN_DECLS here as they are usually from cdefs.h and are not 
> available on Solaris.
>
> Perhaps this should be broken out to a DISPATCH_SHIMS_CDEFS instead?

Unfortunately, we can't rely on config.h-based tests in the public headers, so 
this particular formulation of conditional cdefs.h inclusion won't work here 
(although it was fine in private.h, which I've committed as r141).  Maybe we 
need to go with OS defines here for that reason.

Robert

>
> Joakim
>
> octo.tbricks.com:gcd/trunk/dispatch> svn diff
> Index: dispatch.h
> ===================================================================
> --- dispatch.h	(revision 140)
> +++ dispatch.h	(working copy)
> @@ -25,7 +25,20 @@
> #include <Availability.h>
> #include <TargetConditionals.h>
> #endif
> +#if HAVE_SYS_CDEFS_H
> #include <sys/cdefs.h>
> +#endif
> +
> +#ifndef __BEGIN_DECLS
> +#  if defined(__cplusplus)
> +#    define __BEGIN_DECLS	extern "C" {
> +#    define __END_DECLS		};
> +#  else /* __BEGIN_DECLS */
> +#    define __BEGIN_DECLS
> +#    define __END_DECLS
> +#  endif /* __BEGIN_DECLS */
> +#endif /* __BEGIN_DECLS */
> +
> #include <stddef.h>
> #include <stdint.h>
> #include <stdbool.h>
>
> _______________________________________________
> 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