Bug 7338 - SWT.getPlatform() returns invalid platform
Summary: SWT.getPlatform() returns invalid platform
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 1.0   Edit
Hardware: Other Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Christophe Cornu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-08 08:46 EST by Michael Brung CLA
Modified: 2002-01-08 10:40 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Brung CLA 2002-01-08 08:46:23 EST
With build 2020 of SWT, the SWT.getPlatform() method returns "unknown" on 
PocketPC, although the result should be "win32". The snippet below demonstrates 
this behaviour. On Windows NT it correctly returns "win32".

import org.eclipse.swt.SWT;

public class GetPlatformTest {

	public static void main(String[] args) {
		/*
		 * SWT.getPlatform() should return Win32.
		 * In this case it will return "unknown",
		 */
		System.out.println(SWT.getPlatform());
		System.out.println(System.getProperty("os.name"));
	}
}
Comment 1 Christophe Cornu CLA 2002-01-08 10:40:59 EST
Fix will be available in incoming build 2021. You'll need the new dll.
Function will return "win32" as on Windows desktops
Note: aside of this bug, we may want to discuss using SWT.getPlatform() to 
return more info (like: win32,ppc, or win32,ppc2002 or something like this?)


Internal details:
Callback.h: constant WIN32 not defined on WinCE, use _WIN32_WCE instead. 
Code for callbacks was working by 'accident' on default values. Fixed to use 
regular windows ones even if they end up being equivalent.
LRESULT is defined as a LONG aka an int as is the default value.
CALLBACK was defined to default "" instead of __stdcall which happens to be 
defined as the default cdecl on Windows CE anyway (see windef.h for PPC).