summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXImage.c
diff options
context:
space:
mode:
authorculler <culler>2021-11-09 20:34:22 (GMT)
committerculler <culler>2021-11-09 20:34:22 (GMT)
commite3db95d5882e8cf0750989b7311f69c3fdabf065 (patch)
tree6be9f7ee314849fafc6f71d1dd4bc33858f2226b /macosx/tkMacOSXImage.c
parent7cc3f03be6db944de078dee41314ebb5aa841b0e (diff)
downloadtk-e3db95d5882e8cf0750989b7311f69c3fdabf065.zip
tk-e3db95d5882e8cf0750989b7311f69c3fdabf065.tar.gz
tk-e3db95d5882e8cf0750989b7311f69c3fdabf065.tar.bz2
Fix [e699a7b606]: Fix build on macOS<10.12 - patch from Christopher Chavez.
Diffstat (limited to 'macosx/tkMacOSXImage.c')
-rw-r--r--macosx/tkMacOSXImage.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index 1ca7b64..f256d7a 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -13,6 +13,7 @@
*/
#include "tkMacOSXPrivate.h"
+#include "tkMacOSXConstants.h"
#include "xbytes.h"
static CGImageRef CreateCGImageFromPixmap(Drawable pixmap);
@@ -68,7 +69,7 @@ typedef struct RGBA32pixel_t {
/*
* ARGB32 0xAARRGGBB (Byte order is ARGB on big-endian systems.)
* This is used by Aqua Tk for XImages and by NSBitmapImageReps whose
- * bitmapFormat property is NSBitmapFormatAlphaFirst.
+ * bitmapFormat property is NSAlphaFirstBitmapFormat.
*/
typedef struct ARGB32pixel_t {
@@ -775,7 +776,7 @@ XGetImage(
size = [bitmapRep bytesPerPlane];
bytes_per_row = [bitmapRep bytesPerRow];
bitmap = (char *)ckalloc(size);
- if ((bitmap_fmt != 0 && bitmap_fmt != NSBitmapFormatAlphaFirst)
+ if ((bitmap_fmt != 0 && bitmap_fmt != NSAlphaFirstBitmapFormat)
|| [bitmapRep samplesPerPixel] != 4
|| [bitmapRep isPlanar] != 0
|| bytes_per_row < 4 * width
@@ -802,7 +803,7 @@ XGetImage(
flipped.rgba.blue = pixel.argb.blue;
flipped.rgba.alpha = pixel.argb.alpha;
*((pixel32 *)(bitmap + m)) = flipped;
- } else { // bitmap_fmt = NSBitmapFormatAlphaFirst
+ } else { // bitmap_fmt = NSAlphaFirstBitmapFormat
*((pixel32 *)(bitmap + m)) = pixel;
}
}