Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Kacper Michajłow via ffmpeg-devel" <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: "Kacper Michajłow" <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avutil/attributes: add AV_HAS_ATTRIBUTE (PR #20677)
Date: Thu, 09 Oct 2025 04:26:15 -0000
Message-ID: <175998397607.65.15565141339371663137@bf249f23a2c8> (raw)

PR #20677 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20677
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20677.patch

Maybe useful and to fix MSVC preprocessor warnings.

Fixes: afad332d77278232662e6d8c95c2fc80cb44c8dd


From 3a8ea78b88d14ac2a3d6dddbf22a3f00ba1ee8d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
Date: Thu, 9 Oct 2025 06:22:39 +0200
Subject: [PATCH] avutil/attributes: add AV_HAS_ATTRIBUTE
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Maybe useful and to fix MSVC preprocessor warnings.

Fixes: afad332d77278232662e6d8c95c2fc80cb44c8dd
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
 libavutil/attributes.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavutil/attributes.h b/libavutil/attributes.h
index 2bdf5ed4e4..9e0222a691 100644
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@ -40,6 +40,12 @@
 #    define AV_HAS_BUILTIN(x) 0
 #endif
 
+#ifdef __has_attribute
+#    define AV_HAS_ATTRIBUTE(x) __has_attribute(x)
+#else
+#    define AV_HAS_ATTRIBUTE(x) 0
+#endif
+
 #if defined(__cplusplus) && defined(__has_cpp_attribute)
 #    define AV_HAS_STD_ATTRIBUTE(x) __has_cpp_attribute(x)
 #elif !defined(__cplusplus) && defined(__has_c_attribute)
@@ -183,13 +189,13 @@
 
 #ifdef __MINGW_PRINTF_FORMAT
 #    define AV_PRINTF_FMT __MINGW_PRINTF_FORMAT
-#elif defined(__has_attribute) && __has_attribute(format)
+#elif AV_HAS_ATTRIBUTE(format)
 #    define AV_PRINTF_FMT __printf__
 #endif
 
 #ifdef __MINGW_SCANF_FORMAT
 #    define AV_SCANF_FMT __MINGW_SCANF_FORMAT
-#elif defined(__has_attribute) && __has_attribute(format)
+#elif AV_HAS_ATTRIBUTE(format)
 #    define AV_SCANF_FMT __scanf__
 #endif
 
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-10-09  4:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=175998397607.65.15565141339371663137@bf249f23a2c8 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ http://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git