octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is the version of MacOS available to CPP ?


From: Ben Abbott
Subject: Is the version of MacOS available to CPP ?
Date: Sat, 09 Jun 2012 11:18:51 -0400

With MacOS 10.7.x, Apple has deprecated CGDisplayBitsPerPixel. Adding the code 
below to display.cc will allow the sources to be built with 
"--with-framework-carbon", but isn't the right solution for earlier versions of 
MacOS X.

#if defined (HAVE_FRAMEWORK_CARBON)
size_t CGDisplayBitsPerPixel (CGDirectDisplayID display)
{
  CGDisplayModeRef mode = CGDisplayCopyDisplayMode (display);
  CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding (mode);

  if (CFStringCompare (pixelEncoding, CFSTR (IO32BitDirectPixels), 0) == 0)
    return 32;
  else if (CFStringCompare (pixelEncoding, CFSTR (IO16BitDirectPixels), 0) == 0)
    return 16;
  else 
    return 8;
}
#endif

Is the version of MacOS X available to the preprocessor ?

Ben
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]