Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6463007

jawt_md.h uses non-portable anonymous union declaration

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 5.0
    • client-libs
    • 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.

            denis Denis Fokin (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: