diff options
author | Lakshmi Shanmugam | 2014-12-05 07:06:38 +0000 |
---|---|---|
committer | Lakshmi Shanmugam | 2014-12-05 07:06:38 +0000 |
commit | e9c72eb060d98dac0e738e417cd0d13b7c297515 (patch) | |
tree | 4fe03ea28e555661d8211cf18a18afed9b138e6e /bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa | |
parent | 1923150c6247ba114125b67b97b2bcc3742f00f9 (diff) | |
download | eclipse.platform.swt-e9c72eb060d98dac0e738e417cd0d13b7c297515.tar.gz eclipse.platform.swt-e9c72eb060d98dac0e738e417cd0d13b7c297515.tar.xz eclipse.platform.swt-e9c72eb060d98dac0e738e417cd0d13b7c297515.zip |
Bug 448510 - OS.VERSION is 0x1090 on Yosemite (same as on 10.9)
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java index a205c2a1a7..b80e5c4ae3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java @@ -17,11 +17,26 @@ public class OS extends C { Library.loadLibrary("swt-pi"); //$NON-NLS-1$ } + /** + * NOTE: For new code, use {@link #VERSION_MMB} and {@link #VERSION_MMB(int, int, int)} + */ public static final int VERSION; + public static final int VERSION_MMB; static { int [] response = new int [1]; OS.Gestalt (OS.gestaltSystemVersion, response); - VERSION = response [0] & 0xffff; + VERSION = response [0] & 0xffff; + OS.Gestalt (OS.gestaltSystemVersionMajor, response); + int major = response [0]; + OS.Gestalt (OS.gestaltSystemVersionMinor, response); + int minor = response [0]; + OS.Gestalt (OS.gestaltSystemVersionBugFix, response); + int bugFix = response [0]; + VERSION_MMB = VERSION_MMB (major, minor, bugFix); + } + + public static int VERSION_MMB (int major, int minor, int bugFix) { + return (major << 16) + (minor << 8) + bugFix; } /* @@ -38,6 +53,9 @@ public class OS extends C { public static final double /*float*/ MAX_TEXT_CONTAINER_SIZE = 0.5e7f; public static final int gestaltSystemVersion = ('s'<<24) + ('y'<<16) + ('s'<<8) + 'v'; + public static final int gestaltSystemVersionMajor = ('s'<<24) + ('y'<<16) + ('s'<<8) + '1'; + public static final int gestaltSystemVersionMinor = ('s'<<24) + ('y'<<16) + ('s'<<8) + '2'; + public static final int gestaltSystemVersionBugFix = ('s'<<24) + ('y'<<16) + ('s'<<8) + '3'; public static final int noErr = 0; public static final int kProcessTransformToForegroundApplication = 1; public static final int kSystemIconsCreator = ('m' << 24) + ('a' << 16) + ('c' << 8) + 's'; |