Index: trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.h
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.h	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.h	(revision 187)
@@ -77,7 +77,7 @@
 // to proper JNI functions.
 #ifdef __WIN32OS2__
-#define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast<jchar*>(x), static_cast<jsize>(_tcslen(reinterpret_cast<LPTSTR>(x))))
+#define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast<const jchar*>(x), static_cast<jsize>(_tcslen(reinterpret_cast<LPCTSTR>(x))))
 #define JNU_GetStringPlatformChars(env, x, y) (LPWSTR)env->GetStringChars(x, y)
-#define JNU_ReleaseStringPlatformChars(env, x, y) env->ReleaseStringChars(x, reinterpret_cast<jchar*>(y))
+#define JNU_ReleaseStringPlatformChars(env, x, y) env->ReleaseStringChars(x, reinterpret_cast<const jchar*>(y))
 #else
 #define JNU_NewStringPlatform(env, x) env->NewString(x, static_cast<jsize>(_tcslen(x)))
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Button.cpp
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Button.cpp	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Button.cpp	(revision 187)
@@ -107,5 +107,5 @@
             labelStr = L"";
         } else {
-            labelStr = env->GetStringChars(label, JNI_FALSE);
+            labelStr = (LPCWSTR)env->GetStringChars(label, JNI_FALSE);
         }
         style = 0;
@@ -129,5 +129,5 @@
         c->UpdateBackground(env, target);
         if (label != NULL)
-            env->ReleaseStringChars(label, labelStr);
+            env->ReleaseStringChars(label, (jchar*)labelStr);
     } catch (...) {
         env->DeleteLocalRef(target);
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Canvas.cpp
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Canvas.cpp	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Canvas.cpp	(revision 187)
@@ -212,7 +212,8 @@
 
     PDATA pData;
+    AwtCanvas *c;
     JNI_CHECK_PEER_GOTO(canvas, ret);
 
-    AwtCanvas *c = (AwtCanvas*)pData;
+    c = (AwtCanvas*)pData;
     c->m_eraseBackground = doErase;
     c->m_eraseBackgroundOnResize = doEraseOnResize;
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp	(revision 187)
@@ -107,5 +107,5 @@
             label = (jstring)env->GetObjectField(target, AwtCheckbox::labelID);
             if (label != NULL) {
-                labelStr = env->GetStringChars(label, 0);
+                labelStr = (LPCWSTR)env->GetStringChars(label, 0);
             }
             if (labelStr != 0) {
@@ -124,5 +124,5 @@
 
                 if (labelStr != defaultLabelStr) {
-                    env->ReleaseStringChars(label, labelStr);
+                    env->ReleaseStringChars(label, (jchar*)labelStr);
                 }
             } else {
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Choice.h
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Choice.h	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Choice.h	(revision 187)
@@ -77,5 +77,5 @@
 
     BOOL ActMouseMessage(MSG * pMsg);
-    INLINE BOOL AwtChoice::IsChoiceOpened() {return SendMessage(CB_GETDROPPEDSTATE, 0, 0);}
+    INLINE BOOL IsChoiceOpened() {return SendMessage(CB_GETDROPPEDSTATE, 0, 0);}
 
     static BOOL mouseCapture;
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Clipboard.cpp
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Clipboard.cpp	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Clipboard.cpp	(revision 187)
@@ -260,5 +260,5 @@
         LPMETAFILEPICT lpMfpOld = (LPMETAFILEPICT)lpbMfpBuffer;
 
-        HMETAFILEPICT hmfp = ::GlobalAlloc(GALLOCFLG, sizeof(METAFILEPICT));
+        HMETAFILEPICT hmfp = (HMETAFILEPICT)::GlobalAlloc(GALLOCFLG, sizeof(METAFILEPICT));
         if (hmfp == NULL) {
             VERIFY(::DeleteMetaFile(hmf));
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp	(revision 187)
@@ -28,4 +28,8 @@
 #include <zmouse.h>
 
+#ifdef __WIN32OS2__
+#include <minivcrt.h>
+#endif
+
 #include "jlong.h"
 #include "awt_AWTEvent.h"
@@ -71,5 +75,7 @@
 #include <tchar.h>
 #include <imm.h>
+#ifndef __WIN32OS2__
 #include <ime.h>
+#endif
 // End -- Win32 SDK include files
 
@@ -83,5 +89,5 @@
 
 // <XXX> <!-- TEMPORARY HACK TO TEST AGAINST OLD VC INLCUDES -->
-#if !defined(__int3264)
+#if !defined(__int3264) && !defined(__WIN32OS2__)
 #define GetWindowLongPtr GetWindowLong
 #define SetWindowLongPtr SetWindowLong
@@ -3077,4 +3083,5 @@
     {java_awt_event_KeyEvent_VK_NONCONVERT,       VK_NONCONVERT},
     {java_awt_event_KeyEvent_VK_INPUT_METHOD_ON_OFF, VK_KANJI},
+#ifndef __WIN32OS2__
     {java_awt_event_KeyEvent_VK_ALPHANUMERIC,     VK_DBE_ALPHANUMERIC},
     {java_awt_event_KeyEvent_VK_KATAKANA,         VK_DBE_KATAKANA},
@@ -3083,4 +3090,5 @@
     {java_awt_event_KeyEvent_VK_HALF_WIDTH,       VK_DBE_SBCSCHAR},
     {java_awt_event_KeyEvent_VK_ROMAN_CHARACTERS, VK_DBE_ROMAN},
+#endif
 
     {java_awt_event_KeyEvent_VK_UNDEFINED,        0}
@@ -3328,8 +3336,10 @@
             *modifiers = java_awt_event_InputEvent_SHIFT_DOWN_MASK;
             return;
+#ifndef __WIN32OS2__
         case java_awt_event_KeyEvent_VK_CODE_INPUT:
             *windowsKey = VK_DBE_ALPHANUMERIC;
             *modifiers = java_awt_event_InputEvent_ALT_DOWN_MASK;
             return;
+#endif
         case java_awt_event_KeyEvent_VK_KANA_LOCK:
             if (isKanaLockAvailable()) {
@@ -3398,4 +3408,5 @@
             }
             break;
+#ifndef __WIN32OS2__
         case VK_DBE_ALPHANUMERIC:
             if ((modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK) != 0) {
@@ -3403,4 +3414,5 @@
             }
             break;
+#endif
         case VK_KANA:
             if (isKanaLockAvailable()) {
@@ -3868,5 +3880,5 @@
         return;
     }
-    COMPOSITIONFORM cf = {CFS_POINT, {0, r.bottom}, NULL};
+    COMPOSITIONFORM cf = {CFS_POINT, {0, r.bottom}, {0,0,0,0}};
     // Place the composition window right below the client Window
     ImmSetCompositionWindow(hIMC, &cf);
@@ -5335,5 +5347,5 @@
 void AwtComponent::BeginValidate()
 {
-    DASSERT(m_validationNestCount >= 0 &&
+    DASSERT(/*m_validationNestCount >= 0 &&*/
            m_validationNestCount < 1000); // sanity check
 
@@ -6732,5 +6744,5 @@
     rfs->cause = env->NewGlobalRef(cause);
 
-    return (jboolean)AwtToolkit::GetInstance().SyncCall(
+    return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall(
         (void*(*)(void*))AwtComponent::_RequestFocus, rfs);
     // global refs and rfs are deleted in _RequestFocus
@@ -6919,5 +6931,5 @@
     TRY;
 
-    return (jboolean)AwtToolkit::GetInstance().SyncCall(
+    return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall(
         (void *(*)(void *))AwtComponent::_NativeHandlesWheelScrolling,
         env->NewGlobalRef(self));
@@ -6940,5 +6952,5 @@
     jobject selfGlobalRef = env->NewGlobalRef(self);
 
-    return (jboolean)AwtToolkit::GetInstance().SyncCall(
+    return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall(
         (void*(*)(void*))AwtComponent::_IsObscured,
         (void *)selfGlobalRef);
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp	(revision 187)
@@ -35,4 +35,11 @@
 
 #include "locale_str.h"
+
+#ifndef max
+#define max(a,b) ( (a>b) ? a : b )
+#endif
+#ifndef min
+#define min(a,b) ( (a<b) ? a : b )
+#endif
 
 #define GALLOCFLG (GMEM_DDESHARE | GMEM_MOVEABLE | GMEM_ZEROINIT)
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Desktop.cpp
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Desktop.cpp	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Desktop.cpp	(revision 187)
@@ -41,6 +41,6 @@
   (JNIEnv *env, jclass cls, jstring uri_j, jstring verb_j)
 {
-    const WCHAR* uri_c = env->GetStringChars(uri_j, JNI_FALSE);
-    const WCHAR* verb_c = env->GetStringChars(verb_j, JNI_FALSE);
+    const WCHAR* uri_c = (const WCHAR*)env->GetStringChars(uri_j, JNI_FALSE);
+    const WCHAR* verb_c = (const WCHAR*)env->GetStringChars(verb_j, JNI_FALSE);
 
     // 6457572: ShellExecute possibly changes FPU control word - saving it here
@@ -49,6 +49,6 @@
     _control87(oldcontrol87, 0xffffffff);
 
-    env->ReleaseStringChars(uri_j, uri_c);
-    env->ReleaseStringChars(verb_j, verb_c);
+    env->ReleaseStringChars(uri_j, (jchar*)uri_c);
+    env->ReleaseStringChars(verb_j, (jchar*)verb_c);
 
     if ((int)retval <= 32) {
@@ -66,5 +66,5 @@
                     NULL );
 
-        jstring errmsg = env->NewString((LPCWSTR)buffer, len);
+        jstring errmsg = env->NewString((jchar*)buffer, len);
         LocalFree(buffer);
         return errmsg;
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp	(revision 187)
@@ -36,4 +36,11 @@
 #include "shellapi.h"
 
+#ifndef max
+#define max(a,b) ( (a>b) ? a : b )
+#endif
+#ifndef min
+#define min(a,b) ( (a<b) ? a : b )
+#endif
+
 // WDesktopProperties fields
 jfieldID AwtDesktopProperties::pDataID = 0;
@@ -668,5 +675,5 @@
 
 void AwtDesktopProperties::SetStringProperty(LPCTSTR propName, LPTSTR value) {
-    jstring key = JNU_NewStringPlatform(GetEnv(), propName);
+    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
     GetEnv()->CallVoidMethod(self,
                              AwtDesktopProperties::setStringPropertyID,
@@ -676,5 +683,5 @@
 
 void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) {
-    jstring key = JNU_NewStringPlatform(GetEnv(), propName);
+    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
     GetEnv()->CallVoidMethod(self,
                              AwtDesktopProperties::setIntegerPropertyID,
@@ -684,5 +691,5 @@
 
 void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) {
-    jstring key = JNU_NewStringPlatform(GetEnv(), propName);
+    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
     GetEnv()->CallVoidMethod(self,
                              AwtDesktopProperties::setBooleanPropertyID,
@@ -692,5 +699,5 @@
 
 void AwtDesktopProperties::SetColorProperty(LPCTSTR propName, DWORD value) {
-    jstring key = JNU_NewStringPlatform(GetEnv(), propName);
+    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
     GetEnv()->CallVoidMethod(self,
                              AwtDesktopProperties::setColorPropertyID,
@@ -727,5 +734,5 @@
                             // fall back to Microsoft Sans Serif
                             fontName = JNU_NewStringPlatform(GetEnv(),
-                                                    L"Microsoft Sans Serif");
+                                         (const jchar*)L"Microsoft Sans Serif");
                         }
                     }
@@ -744,5 +751,5 @@
                     }
 
-                    jstring key = JNU_NewStringPlatform(GetEnv(), propName);
+                    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
                     GetEnv()->CallVoidMethod(self,
                               AwtDesktopProperties::setFontPropertyID,
@@ -785,5 +792,5 @@
     }
 
-    jstring key = JNU_NewStringPlatform(GetEnv(), propName);
+    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
     GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setFontPropertyID,
                              key, fontName, style, pointSize);
@@ -794,6 +801,6 @@
 
 void AwtDesktopProperties::SetSoundProperty(LPCTSTR propName, LPCTSTR winEventName) {
-    jstring key = JNU_NewStringPlatform(GetEnv(), propName);
-    jstring event = JNU_NewStringPlatform(GetEnv(), winEventName);
+    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
+    jstring event = JNU_NewStringPlatform(GetEnv(), (const jchar*)winEventName);
     GetEnv()->CallVoidMethod(self,
                              AwtDesktopProperties::setSoundPropertyID,
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp	(revision 187)
@@ -150,5 +150,9 @@
         }
         case WM_NOTIFY: {
+#ifdef __WIN32OS2__
+            OFNOTIFY *notifyEx = (OFNOTIFY *)lParam;
+#else
             OFNOTIFYEX *notifyEx = (OFNOTIFYEX *)lParam;
+#endif
             if (notifyEx) {
                 jobject peer = (jobject)(::GetProp(parent, ModalDialogPeerProp));
@@ -223,5 +227,5 @@
 
         if (title == NULL || env->GetStringLength(title)==0) {
-            title = env->NewString(&unicodeChar, 1);
+            title = env->NewString((const jchar*)&unicodeChar, 1);
         }
 
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.h
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.h	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.h	(revision 187)
@@ -34,5 +34,7 @@
 #include <ole2.h>
 #include <richedit.h>
+#ifndef __WIN32OS2__
 #include <richole.h>
+#endif
 
 
Index: trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Unicode.h
===================================================================
--- trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Unicode.h	(revision 186)
+++ trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Unicode.h	(revision 187)
@@ -34,4 +34,7 @@
 
 #include <malloc.h>
+#ifdef __GNUC__
+#include <alloca.h>
+#endif
 
 // Get a Unicode string copy of a Java String object (Java String aren't
