From patchwork Sat Feb 4 10:41:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 40274 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp1870600pzk; Sat, 4 Feb 2023 02:48:11 -0800 (PST) X-Google-Smtp-Source: AK7set/HsCNXf7xRR2X0dsZSTwPThCZz6Yedgr1mXh3WknAWaAunfHRmyjGV/puN2P0DJumuUzhQ X-Received: by 2002:a05:6402:1f83:b0:4a2:51db:c7c6 with SMTP id c3-20020a0564021f8300b004a251dbc7c6mr13343139edc.8.1675507691346; Sat, 04 Feb 2023 02:48:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675507691; cv=none; d=google.com; s=arc-20160816; b=cE9vh9x4FbbR2tuLmUlO/xbniSKLZbtfpPfzJpQlipjXv0iEU/RME+Mv5PgGEQLOtF zZcJGxJj2ZVD69It9V5DccY+yKGAhGNXuu8wFL2MKSI+Om83gUZ5V6xWYGLMuEjfOhCc BE4MOO6ETAwRzOBw6zOoo1mAQNVPrkOMgnOigi4/3jOtqCApSCNlqEb2SZ7ADPUQdi5y DVWwFIfqNt2cAFM1CpfJzhV/dbUvaIJIUWtpSLIaL8pRku+C7d2CKS9iiUbQaQoRbD/0 tRnPkdlnstx0y956/LxHaGIW69LSGCcibywrPwE2Df1/Rv236HSCdZKrzv47KBA2yoOu GsVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=yglchL224br+N5/VqhsGdGFokqLuGjQ/FQDByVaDlr8=; b=jHQEJksYIuDHLiTr4AXKLF3zy0oAJjQ0SttanSaAu/0Vf6CGyj6vVb6twFXk49CB4g Scen5lq7IXmCQzJmSxjxoMolaZuYUY71js8H+YK8Pl5D2Enyat8EcxjYhI6jUYW8DW8Y yGNGspU8+4CeKrOllJ7YJbMUkfxXj+Eyb8yOhEJq9/lE94lOZxQ9MbLeYUjj9upBbwBJ G2NtbVKFkCInx1Wsktc3VgVTaIQHHZmx2UwJ626cItk3CgCuOjG0JN3brg09LB3xnmh8 WuXr54dgKqsYmo32/+T/wR9z0zPNhNBlbz3zZI4m/NSM2Z5J0CNVH4qqvN5eQ6pnNxYD 9TFQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f3-20020a056402194300b004a0e159c229si5418330edz.458.2023.02.04.02.48.11; Sat, 04 Feb 2023 02:48:11 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E7BE468BEEC; Sat, 4 Feb 2023 12:44:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C4E5968BECC for ; Sat, 4 Feb 2023 12:44:20 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 8053A2404EE for ; Sat, 4 Feb 2023 11:44:20 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id xcJE-ZqzJF91 for ; Sat, 4 Feb 2023 11:44:19 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 3D37E2404EC for ; Sat, 4 Feb 2023 11:44:07 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 4A8983A0653 for ; Sat, 4 Feb 2023 11:44:06 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Feb 2023 11:41:57 +0100 Message-Id: <20230204104204.20721-27-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230204104204.20721-1-anton@khirnov.net> References: <20230204104204.20721-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 26/33] avutil: remove FF_API_DECLARE_ALIGNED X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: mzg1aiHyCPL9 From: James Almer Signed-off-by: James Almer --- libavcodec/qdmc.c | 1 + libavutil/mem.h | 80 ---------------------------------------- libavutil/mem_internal.h | 2 - libavutil/version.h | 1 - 4 files changed, 1 insertion(+), 83 deletions(-) diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c index 4b582dc3491..081c4dd46f0 100644 --- a/libavcodec/qdmc.c +++ b/libavcodec/qdmc.c @@ -25,6 +25,7 @@ #define BITSTREAM_READER_LE #include "libavutil/channel_layout.h" +#include "libavutil/mem_internal.h" #include "libavutil/thread.h" #include "libavutil/tx.h" diff --git a/libavutil/mem.h b/libavutil/mem.h index c9c4fcf1ff0..b093b3b5cb0 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -51,86 +51,6 @@ * @{ */ -#if FF_API_DECLARE_ALIGNED -/** - * - * @defgroup lavu_mem_macros Alignment Macros - * Helper macros for declaring aligned variables. - * @{ - */ - -/** - * @def DECLARE_ALIGNED(n,t,v) - * Declare a variable that is aligned in memory. - * - * @code{.c} - * DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42; - * DECLARE_ALIGNED(32, uint8_t, aligned_array)[128]; - * - * // The default-alignment equivalent would be - * uint16_t aligned_int = 42; - * uint8_t aligned_array[128]; - * @endcode - * - * @param n Minimum alignment in bytes - * @param t Type of the variable (or array element) - * @param v Name of the variable - */ - -/** - * @def DECLARE_ASM_ALIGNED(n,t,v) - * Declare an aligned variable appropriate for use in inline assembly code. - * - * @code{.c} - * DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); - * @endcode - * - * @param n Minimum alignment in bytes - * @param t Type of the variable (or array element) - * @param v Name of the variable - */ - -/** - * @def DECLARE_ASM_CONST(n,t,v) - * Declare a static constant aligned variable appropriate for use in inline - * assembly code. - * - * @code{.c} - * DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); - * @endcode - * - * @param n Minimum alignment in bytes - * @param t Type of the variable (or array element) - * @param v Name of the variable - */ - -#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v -#elif defined(__DJGPP__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v - #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v -#elif defined(__GNUC__) || defined(__clang__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v -#elif defined(_MSC_VER) - #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v - #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v - #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v -#else - #define DECLARE_ALIGNED(n,t,v) t v - #define DECLARE_ASM_ALIGNED(n,t,v) t v - #define DECLARE_ASM_CONST(n,t,v) static const t v -#endif - -/** - * @} - */ -#endif - /** * @defgroup lavu_mem_attrs Function Attributes * Function attributes applicable to memory handling functions. diff --git a/libavutil/mem_internal.h b/libavutil/mem_internal.h index 955e31a6981..2448c606f19 100644 --- a/libavutil/mem_internal.h +++ b/libavutil/mem_internal.h @@ -30,7 +30,6 @@ #include "mem.h" #include "version.h" -#if !FF_API_DECLARE_ALIGNED /** * @def DECLARE_ALIGNED(n,t,v) * Declare a variable that is aligned in memory. @@ -97,7 +96,6 @@ #define DECLARE_ASM_ALIGNED(n,t,v) t v #define DECLARE_ASM_CONST(n,t,v) static const t v #endif -#endif // Some broken preprocessors need a second expansion // to be forced to tokenize __VA_ARGS__ diff --git a/libavutil/version.h b/libavutil/version.h index 38769962cc3..6014743947c 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -105,7 +105,6 @@ * @{ */ -#define FF_API_DECLARE_ALIGNED (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 58)