diff mbox series

[FFmpeg-devel,16/18] avutil/hwcontext_vulkan: Include hwcontext.h

Message ID AS8P250MB07444CF18C3D8C4311636DC48F3B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 888e2c0a85d945cd7cddbc9c7434b9f260ac0fa0
Headers show
Series [FFmpeg-devel,01/18] avcodec/mips/ac3dsp_mips: Add missing includes | expand


Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 28, 2024, 11:10 p.m. UTC
struct Foo * declares a new type (namely struct Foo)
if there is no declaration of struct Foo already visible
in the current scope; otherwise it is just a pointer to
an element of the already declared type "struct Foo".
There is a gotcha with the first case:
struct Foo is only declared in its scope; a later declaration
of struct Foo in an enclosing scope declares a different type.

This happens in hwcontext_vulkan.h if it is included before
hwcontext.h, because some declarations of struct AVHWDeviceContext
and struct AVHWFramesContext have function prototype scope.

Compilers warn about this (during checkheaders):
‘struct AVHWDeviceContext’ declared inside parameter list will not
be visible outside of this definition or declaration

Fix this by including hwcontext.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
 libavutil/hwcontext_vulkan.h | 1 +
 1 file changed, 1 insertion(+)
diff mbox series


diff --git a/libavutil/hwcontext_vulkan.h b/libavutil/hwcontext_vulkan.h
index 895794c867..cbbd2390c1 100644
--- a/libavutil/hwcontext_vulkan.h
+++ b/libavutil/hwcontext_vulkan.h
@@ -26,6 +26,7 @@ 
 #include "pixfmt.h"
 #include "frame.h"
+#include "hwcontext.h"
 typedef struct AVVkFrame AVVkFrame;