diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-02-10 11:06:19 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-02-10 11:06:19 (GMT) |
commit | d015e4d8b48ad76acce178827f3ab114c330308c (patch) | |
tree | 75ae24370f3056d16427e5a17c5a9aaf6e1351e6 /generic/tkImgPhInstance.c | |
parent | 3655db8b8d9c31f3253d97a9ea250b07641c24d9 (diff) | |
download | tk-d015e4d8b48ad76acce178827f3ab114c330308c.zip tk-d015e4d8b48ad76acce178827f3ab114c330308c.tar.gz tk-d015e4d8b48ad76acce178827f3ab114c330308c.tar.bz2 |
Eliminate all usage of __WIN32__ macro: Some compilers (e.g. Clang/LLVM) don't define it, and _WIN32 is much more portable anyway.
See: [http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system#WindowsCygwinnonPOSIXandMinGW]
Diffstat (limited to 'generic/tkImgPhInstance.c')
-rw-r--r-- | generic/tkImgPhInstance.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c index 01f11bb..666a9b0 100644 --- a/generic/tkImgPhInstance.c +++ b/generic/tkImgPhInstance.c @@ -407,7 +407,7 @@ TkImgPhotoGet( *---------------------------------------------------------------------- */ -#ifndef __WIN32__ +#ifndef _WIN32 #define GetRValue(rgb) (UCHAR(((rgb) & red_mask) >> red_shift)) #define GetGValue(rgb) (UCHAR(((rgb) & green_mask) >> green_shift)) #define GetBValue(rgb) (UCHAR(((rgb) & blue_mask) >> blue_shift)) @@ -419,7 +419,7 @@ TkImgPhotoGet( (((r) * red_mask / 255) & red_mask) | \ (((g) * green_mask / 255) & green_mask) | \ (((b) * blue_mask / 255) & blue_mask) )) -#endif /* !__WIN32__ */ +#endif /* !_WIN32 */ static void BlendComplexAlpha( @@ -453,7 +453,7 @@ BlendComplexAlpha( * might be cached for better performance. */ -#ifndef __WIN32__ +#ifndef _WIN32 unsigned long red_mask, green_mask, blue_mask; unsigned long red_shift, green_shift, blue_shift; Visual *visual = iPtr->visualInfo.visual; @@ -473,7 +473,7 @@ BlendComplexAlpha( while ((0x0001 & (blue_mask >> blue_shift)) == 0) { blue_shift++; } -#endif /* !__WIN32__ */ +#endif /* !_WIN32 */ /* * Only UNIX requires the special case for <24bpp. It varies with 3 extra @@ -481,7 +481,7 @@ BlendComplexAlpha( * optimized. */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) +#if !(defined(_WIN32) || defined(MAC_OSX_TK)) if (bgImg->depth < 24) { unsigned char red_mlen, green_mlen, blue_mlen; @@ -529,7 +529,7 @@ BlendComplexAlpha( } return; } -#endif /* !__WIN32__ && !MAC_OSX_TK */ +#endif /* !_WIN32 && !MAC_OSX_TK */ for (y = 0; y < height; y++) { line = (y + yOffset) * iPtr->masterPtr->width; @@ -1336,12 +1336,12 @@ AllocateColors( * since we will be passing the color table into the TkPutImage call. */ -#ifndef __WIN32__ +#ifndef _WIN32 if ((colorPtr->visualInfo.class != DirectColor) && (colorPtr->visualInfo.class != TrueColor)) { colorPtr->flags |= MAP_COLORS; } -#endif /* __WIN32__ */ +#endif /* _WIN32 */ } colorPtr->numColors = numColors; @@ -1770,7 +1770,7 @@ TkImgDitherInstance( case NBBY: *destBytePtr++ = i; break; -#ifndef __WIN32__ +#ifndef _WIN32 /* * This case is not valid for Windows because the * image format is different from the pixel format in @@ -1832,7 +1832,7 @@ TkImgDitherInstance( case NBBY: *destBytePtr++ = i; break; -#ifndef __WIN32__ +#ifndef _WIN32 /* * This case is not valid for Windows because the * image format is different from the pixel format in |