Opened 11 years ago

Last modified 11 years ago

#40724 closed defect

Wine build under OSX 10.9 — at Initial Version

Reported by: mattbrocklehurst@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: mavericks Cc:
Port: wine

Description

Received this when I tried getting Wine to build (after doing hack documented earlier)

gdi.c:144:5: error: use of undeclared identifier 'CGDirectPaletteRef'

CGDirectPaletteRef palette;

gdi.c:190:5: error: use of undeclared identifier 'palette'

palette = CGPaletteCreateWithDisplay(mainDisplay);

gdi.c:191:9: error: use of undeclared identifier 'palette'

if (palette)

gdi.c:193:52: error: use of undeclared identifier 'palette'

palette_size = CGPaletteGetNumberOfSamples(palette);

gdi.c:194:26: error: use of undeclared identifier 'palette'

CGPaletteRelease(palette);

5 errors generated. make[1]: * [gdi.o] Error 1 make: * [dlls/winemac.drv] Error 2 make: * Waiting for unfinished jobs....

Looking around this is in WineHQ and has been patched

http://bugs.winehq.org/show_bug.cgi?id=34162

So modified Port file to include patch

/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/x11/wine/Portfile

patchfiles                  BOOL.patch \
                            mach_machine.patch \
                            gdi.patch \
                            tiger-shell.patch

And added patch to /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/x11/wine/files/gdi.patch

--- dlls/winemac.drv/gdi.c.orig
+++ dlls/winemac.drv/gdi.c
@@ -49,7 +49,6 @@ static int vert_res;            /* height in pixels of screen */
 static int desktop_horz_res;    /* width in pixels of virtual desktop */
 static int desktop_vert_res;    /* height in pixels of virtual desktop */
 static int bits_per_pixel;      /* pixel depth of screen */
-static int palette_size;        /* number of color entries in palette */
 static int device_data_valid;   /* do the above variables have up-to-date values? */
 
 static CRITICAL_SECTION device_data_section;
@@ -141,7 +140,6 @@ static void device_init(void)
     CGDirectDisplayID mainDisplay = CGMainDisplayID();
     CGSize size_mm = CGDisplayScreenSize(mainDisplay);
     CGDisplayModeRef mode = CGDisplayCopyDisplayMode(mainDisplay);
-    CGDirectPaletteRef palette;
 
     /* Initialize device caps */
     log_pixels_x = log_pixels_y = get_dpi();
@@ -187,15 +185,6 @@ static void device_init(void)
     desktop_horz_res = desktop_rect.size.width;
     desktop_vert_res = desktop_rect.size.height;
 
-    palette = CGPaletteCreateWithDisplay(mainDisplay);
-    if (palette)
-    {
-        palette_size = CGPaletteGetNumberOfSamples(palette);
-        CGPaletteRelease(palette);
-    }
-    else
-        palette_size = 0;
-
     device_data_valid = TRUE;
 }
 
@@ -368,7 +357,7 @@ static INT macdrv_GetDeviceCaps(PHYSDEV dev, INT cap)
     case RASTERCAPS:
         ret = (RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 | RC_DI_BITMAP |
                RC_DIBTODEV | RC_BIGFONT | RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS |
-               (palette_size ? RC_PALETTE : 0));
+               (bits_per_pixel <= 8 ? RC_PALETTE : 0));
         break;
     case SHADEBLENDCAPS:
         ret = (SB_GRAD_RECT | SB_GRAD_TRI | SB_CONST_ALPHA | SB_PIXEL_ALPHA);
@@ -393,7 +382,7 @@ static INT macdrv_GetDeviceCaps(PHYSDEV dev, INT cap)
         ret = 0;
         break;
     case SIZEPALETTE:
-        ret = palette_size;
+        ret = bits_per_pixel <= 8 ? 1 << bits_per_pixel : 0;
         break;
     case NUMRESERVED:
     case PHYSICALWIDTH:

And everything seemed to build ok.

Change History (0)

Note: See TracTickets for help on using tickets.