#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
+#ifndef __MWERKS__
#include <memory.h>
+#endif
#include "wx/msw/dib.h"
goto ErrExit;
}
- if (!(nNumColors = (WORD)lpbi->biClrUsed))
+ nNumColors = (WORD)lpbi->biClrUsed;
+ if ( nNumColors == 0 )
{
/* no color table for 24-bit, default size otherwise */
if (lpbi->biBitCount != 24)
lpInfo = (LPBITMAPINFOHEADER) GlobalLock(hDIB);
#endif
- if ((hPalette = MakeDIBPalette(lpInfo)))
+ hPalette = MakeDIBPalette(lpInfo);
+ if ( hPalette )
{
// Need to realize palette for converting DIB to bitmap.
hOldPal = SelectPalette(hDC, hPalette, TRUE);