-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
5.0
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The jawt_md.h header file for JAWT, the AWT native interface, is using a non-portable anonymous union which fails to compile under GCC (MinGW):
typedef struct jawt_Win32DrawingSurfaceInfo {
/* Native window, DDB, or DIB handle */
union {
HWND hwnd;
HBITMAP hbitmap;
void* pbits;
};
/*
* This HDC should always be used instead of the HDC returned from
* BeginPaint() or any calls to GetDC().
*/
HDC hdc;
HPALETTE hpalette;
} JAWT_Win32DrawingSurfaceInfo;
Anonymous unions are allowed under C++ but not under C, unless the MS Visual C++ compiler is used (in C mode). If this is not corrected, I can't cleanly compile JNI code that uses the JAWT bridge under windows.
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The jawt_md.h header file for JAWT, the AWT native interface, is using a non-portable anonymous union which fails to compile under GCC (MinGW):
typedef struct jawt_Win32DrawingSurfaceInfo {
/* Native window, DDB, or DIB handle */
union {
HWND hwnd;
HBITMAP hbitmap;
void* pbits;
};
/*
* This HDC should always be used instead of the HDC returned from
* BeginPaint() or any calls to GetDC().
*/
HDC hdc;
HPALETTE hpalette;
} JAWT_Win32DrawingSurfaceInfo;
Anonymous unions are allowed under C++ but not under C, unless the MS Visual C++ compiler is used (in C mode). If this is not corrected, I can't cleanly compile JNI code that uses the JAWT bridge under windows.
REPRODUCIBILITY :
This bug can be reproduced always.