[libdispatch-dev] [PATCH 4/4]
Mario Schwalbe
schwalbe at inf.tu-dresden.de
Wed Nov 18 06:19:09 PST 2009
Hi,
Standard versions of GCC don't define __unused.
And LLVM/GCC doesn't define __block anymore.
I don't know whether it is right to put it in testing/dispatch_test.h,
but it at least affects all test applications at once.
Together with the other patches I sent the last days, this is everything
required to compile and use libdispatch on Linux (with the exception of
queue_finalizer due to arc4random).
ciao,
Mario
Index: testing/dispatch_test.h
===================================================================
--- testing/dispatch_test.h (Revision 171)
+++ testing/dispatch_test.h (Arbeitskopie)
@@ -1,5 +1,18 @@
#include <errno.h>
+/* standard GCC and LLVM/GCC don't define __unused by default */
+#ifndef __unused
+ #define __unused __attribute__((__unused__))
+#endif
+
+/* standard LLVM/GCC doesn't define __block by default, because
+ * used as a parameter name in include/c++/4.2.1/ext/mt_allocator.h as well */
+#if __BLOCKS__
+ #ifndef __block
+ #define __block __attribute__((__blocks__(byref)))
+ #endif
+#endif
+
__BEGIN_DECLS
void test_start(const char* desc);
More information about the libdispatch-dev
mailing list