From 4ebe7d62159257cae48d47afd4d8ce2ecf0afb6e Mon Sep 17 00:00:00 2001 From: Krzysztof Szenk Date: Tue, 24 Feb 2026 12:56:16 +0100 Subject: [PATCH] win32 clipboard: fix for BI_ALPHABITFIELDS narrow support (#5586) * win32 clipbaord: fix for BI_ALPHABITFIELDS narrow support * Define BI_ALPHABITFIELDS even if wingdi headers are already included since BI_ALPHABITFIELDS is not always defined there --- src/external/win32_clipboard.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/external/win32_clipboard.h b/src/external/win32_clipboard.h index 1cb05457d..c85b3882a 100644 --- a/src/external/win32_clipboard.h +++ b/src/external/win32_clipboard.h @@ -178,7 +178,9 @@ typedef struct tagRGBQUAD { #define BI_CMYK 0x000B #define BI_CMYKRLE8 0x000C #define BI_CMYKRLE4 0x000D +#endif +#ifndef BI_ALPHABITFIELDS // Bitmap not compressed and that the color table consists of four DWORD color masks, // that specify the red, green, blue, and alpha components of each pixel #define BI_ALPHABITFIELDS 0x0006 @@ -317,7 +319,7 @@ static int GetPixelDataOffset(BITMAPINFOHEADER bih) // If (bih.biCompression == BI_RGB) no need to be offset more if (bih.biCompression == BI_BITFIELDS) offset += 3*rgbaSize; - else if (bih.biCompression == BI_ALPHABITFIELDS) offset += 4*rgbaSize; // Not widely supported, but valid + else if (bih.biCompression == BI_ALPHABITFIELDS) offset += 4 * rgbaSize; // Not widely supported, but valid } }