diff options
author | Lynne <dev@lynne.ee> | 2023-03-24 02:22:06 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2023-05-29 00:41:49 +0200 |
commit | a4d63b46d9a0ae8efeda66cd9e3e810c9fc26470 (patch) | |
tree | 3dfc987b849e3247b6c8d4e3c95e50a45fe48c40 /libavutil/vulkan.h | |
parent | 83024beec226222334d7e4166da5e4cd0869e7cc (diff) | |
download | ffmpeg-a4d63b46d9a0ae8efeda66cd9e3e810c9fc26470.tar.gz |
vulkan: make GLSL macro functions semicolumn-safe
Diffstat (limited to 'libavutil/vulkan.h')
-rw-r--r-- | libavutil/vulkan.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h index 1dc7a61d97..0831219d8f 100644 --- a/libavutil/vulkan.h +++ b/libavutil/vulkan.h @@ -40,12 +40,28 @@ #define INDENT_5 INDENT_4 INDENT_1 #define INDENT_6 INDENT_5 INDENT_1 #define C(N, S) INDENT(N) #S "\n" -#define GLSLC(N, S) av_bprintf(&shd->src, C(N, S)) -#define GLSLA(...) av_bprintf(&shd->src, __VA_ARGS__) -#define GLSLF(N, S, ...) av_bprintf(&shd->src, C(N, S), __VA_ARGS__) -#define GLSLD(D) GLSLC(0, ); \ - av_bprint_append_data(&shd->src, D, strlen(D)); \ - GLSLC(0, ) + +#define GLSLC(N, S) \ + do { \ + av_bprintf(&shd->src, C(N, S)); \ + } while (0) + +#define GLSLA(...) \ + do { \ + av_bprintf(&shd->src, __VA_ARGS__); \ + } while (0) + +#define GLSLF(N, S, ...) \ + do { \ + av_bprintf(&shd->src, C(N, S), __VA_ARGS__); \ + } while (0) + +#define GLSLD(D) \ + do { \ + av_bprintf(&shd->src, "\n"); \ + av_bprint_append_data(&shd->src, D, strlen(D)); \ + av_bprintf(&shd->src, "\n"); \ + } while (0) /* Helper, pretty much every Vulkan return value needs to be checked */ #define RET(x) \ |