From owner-freebsd-questions@FreeBSD.ORG Sat Dec 24 10:02:21 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75E9E1065672 for ; Sat, 24 Dec 2011 10:02:21 +0000 (UTC) (envelope-from olevole@olevole.ru) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0936A8FC0A for ; Sat, 24 Dec 2011 10:02:20 +0000 (UTC) Received: by eekc50 with SMTP id c50so11709056eek.13 for ; Sat, 24 Dec 2011 02:02:19 -0800 (PST) Received: by 10.14.52.1 with SMTP id d1mr7444013eec.58.1324719213649; Sat, 24 Dec 2011 01:33:33 -0800 (PST) Received: from gizmo.my.domain (nat140-249-205-109.tvoe.tv. [109.205.249.140]) by mx.google.com with ESMTPS id t1sm60313660eeb.3.2011.12.24.01.33.31 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 24 Dec 2011 01:33:32 -0800 (PST) From: Oleg Ginzburg To: freebsd-questions@freebsd.org Date: Sat, 24 Dec 2011 13:34:04 +0400 User-Agent: KMail/1.13.7 (FreeBSD/9.0-PRERELEASE; KDE/4.7.3; amd64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201112241334.04812.olevole@olevole.ru> Subject: GCD in FreeBSD with gcc X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2011 10:02:21 -0000 Hi, I try to play with GCD in FreeBSD. Compilation through clang is fine. However when i use the gcc from base for code with dispatch_async i got warning: implicit declaration of function 'dispatch_async' The existing file /usr/local/include/dispatch/queue.h contains the following constructions: #ifdef __BLOCKS__ __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0) DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW void dispatch_async(dispatch_queue_t queue, dispatch_block_t block); #endif It sets some restriction on a number of platforms. Concerning FreeBSD, dispatch_async - it is not ready or these records weren't corrected for FreeBSD ? PS: FreeBSD 9.0-RC3, /usr/ports/devel/libdispatch 210_1 Sample file test.c: -- #include #include #include #include void say_hello(__unused void *arg) { printf("Hi.\n"); exit(0); } int main(int argc, char *argv[]) { dispatch_queue_t q; q = dispatch_get_main_queue(); dispatch_async(q, say_hello); printf("Im Here\n"); dispatch_main(); } -- gcc -Wall -Werror -I/usr/local/include -L/usr/local/lib -o test test.c - ldispatch