From patchwork Tue Mar 7 03:07:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 2779 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.50.79 with SMTP id y76csp372388vsy; Mon, 6 Mar 2017 19:07:32 -0800 (PST) X-Received: by 10.28.7.20 with SMTP id 20mr14891037wmh.115.1488856052066; Mon, 06 Mar 2017 19:07:32 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u4si16953614wma.15.2017.03.06.19.07.31; Mon, 06 Mar 2017 19:07:32 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0165A680507; Tue, 7 Mar 2017 05:07:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f181.google.com (mail-qk0-f181.google.com [209.85.220.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8475968046A for ; Tue, 7 Mar 2017 05:07:09 +0200 (EET) Received: by mail-qk0-f181.google.com with SMTP id 1so187470146qkl.3 for ; Mon, 06 Mar 2017 19:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=y7+Rb/s6jo8CJfiv07qCD/4ivgxwPL7baEW7eVLZRu4=; b=V7ZGTqXOVDzf/8APyufpn74whZZ5Px0hEpyVLYBFc2SCduCJiMEr+8D1jtRx5v552w MMXAnd7AHDhLGKUtCecbhYJvueZDpg7agMLngBYqh4rLOa36TofWTgXU12GsSl//AAzx e+TMeEBBK+tgV7McnZ9tThzBm9ynbjlKwujdOOe51gWbPEM6IcJxwEU7fVhKtKf9lh19 mUYl1Wh+bcXzV2XWMAfsh26L7jxr/THj/2vRhvETYAHProfgBPjeIvQnghcJulLXYt0Y ONXkxG6FgxyphcQ7MS35DnJi6GwW0/KQLx+90RTx9xuUmO1fazNxmVsidUWL+KLbaE9v dcfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=y7+Rb/s6jo8CJfiv07qCD/4ivgxwPL7baEW7eVLZRu4=; b=S+AaTWhoCMZCp22zexGZGQqflVb3LGbduNkkMmNsNN/inXFsV12qBRJQkWO5q/YOBu a6N5CsGnbGZFSM1P+HXQx78t435ABtal9ho8kPh4hV/lf5SWJCUoAOsD8edCUST4T5bq QlQPfxvpprJIVRwHrb7cjDT1eL2MP+i+dKel+5zgio2DPmIhS0l//Wd3k/ky6t5vxgPo aHApXyP7hHeEIpvQO53rONgCdduNwdrz5hidBSOHck+o6+ZXdDbmzjVd/vGZ66IVQKpp U41ZrWPPc8V2PU3KEFw+d1E39ySxy3ogtDY2qu0AhzaM0Uc1Pm4cxrzX1K6VdxkBtGt8 fJFw== X-Gm-Message-State: AMke39nAygM2aYyL14LnJNnFDx0z4ynJvxi6M0ZLzZG0dxfYG8vmP4VVzjkyBQ9bklc75g== X-Received: by 10.237.53.226 with SMTP id d31mr18598716qte.184.1488856040915; Mon, 06 Mar 2017 19:07:20 -0800 (PST) Received: from [192.168.0.4] ([181.231.62.139]) by smtp.googlemail.com with ESMTPSA id j4sm14699604qkc.40.2017.03.06.19.07.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 19:07:20 -0800 (PST) To: FFmpeg development discussions and patches References: <20170306194739.1870-1-mfcc64@gmail.com> <20170307025523.GK5776@nb4> From: James Almer Message-ID: <65c049ef-4028-0fa2-e096-d0f13e86a1f7@gmail.com> Date: Tue, 7 Mar 2017 00:07:18 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170307025523.GK5776@nb4> Subject: Re: [FFmpeg-devel] [PATCH 1/4] avcodec/allcodecs: make avcodec_register_all thread safe X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On 3/6/2017 11:55 PM, Michael Niedermayer wrote: > On Tue, Mar 07, 2017 at 02:47:36AM +0700, Muhammad Faiz wrote: >> Signed-off-by: Muhammad Faiz >> --- >> libavcodec/allcodecs.c | 13 ++++++++++--- >> 1 file changed, 10 insertions(+), 3 deletions(-) > > fails to build > > ibavcodec/allcodecs.c: In function ‘avcodec_register_all’: > libavcodec/allcodecs.c:68:5: error: implicit declaration of function ‘typeof’ [-Werror=implicit-function-declaration] > libavcodec/allcodecs.c:68:33: error: expected ‘;’ before ‘_obj’ > libavcodec/allcodecs.c:68:78: error: expected ‘;’ before ‘_old’ > libavcodec/allcodecs.c:68:87: error: ‘_old’ undeclared (first use in this function) > libavcodec/allcodecs.c:68:87: note: each undeclared identifier is reported only once for each function it appears in > libavcodec/allcodecs.c:68:119: error: ‘_obj’ undeclared (first use in this function) > libavcodec/allcodecs.c:68:78: error: incompatible type for argument 1 of ‘__sync_bool_compare_and_swap’ > cc1: some warnings being treated as errors > make: *** [libavcodec/allcodecs.o] Error 1 > make: *** Waiting for unfinished jobs.... This is from the compat header for c11 atomics on old GCC versions. Looks like it should be using __typeof__ instead. Try the attached patch. From 5af305a9180b691577e48731d9ca84a3b2342404 Mon Sep 17 00:00:00 2001 From: James Almer Date: Tue, 7 Mar 2017 00:04:46 -0300 Subject: [PATCH] compat/atomics/gcc: use __typeof__ instead of typeof Signed-off-by: James Almer --- compat/atomics/gcc/stdatomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compat/atomics/gcc/stdatomic.h b/compat/atomics/gcc/stdatomic.h index 41caddec5c..2b64687437 100644 --- a/compat/atomics/gcc/stdatomic.h +++ b/compat/atomics/gcc/stdatomic.h @@ -100,8 +100,8 @@ do { \ #define atomic_exchange(object, desired) \ ({ \ - typeof(object) _obj = (object); \ - typeof(*object) _old; \ + __typeof__(object) _obj = (object); \ + __typeof__(*object) _old; \ do \ _old = atomic_load(_obj); \ while (!__sync_bool_compare_and_swap(_obj, _old, (desired))); \ @@ -113,8 +113,8 @@ do { \ #define atomic_compare_exchange_strong(object, expected, desired) \ ({ \ - typeof(object) _exp = (expected); \ - typeof(*object) _old = *_exp; \ + __typeof__(object) _exp = (expected); \ + __typeof__(*object) _old = *_exp; \ *_exp = __sync_val_compare_and_swap((object), _old, (desired)); \ *_exp == _old; \ }) -- 2.12.0