Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avutil/attributes: add AV_HAS_ATTRIBUTE (PR #20677)
@ 2025-10-09  4:26 Kacper Michajłow via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: Kacper Michajłow via ffmpeg-devel @ 2025-10-09  4:26 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Kacper Michajłow

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-09  4:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-09  4:26 [FFmpeg-devel] [PATCH] avutil/attributes: add AV_HAS_ATTRIBUTE (PR #20677) Kacper Michajłow via ffmpeg-devel

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