winuser.h missing code for MONITORINFOEX?

Zombiedeth
2008-12-13
2013-06-06
  • Zombiedeth
    Zombiedeth
    2008-12-13

    When attempting to compile MAME with MinGW64 i get the following errors related to function MONITORINFOEX. Am i correct in assuming this is a problem with the winuser.h MinGW64 header file?

    Compiling src/osd/windows/drawdd.c...
    src/osd/windows/drawdd.c: In function 'blit_to_primary':
    src/osd/windows/drawdd.c:991: error: 'MONITORINFOEX' has no member named 'rcMoni
    tor'
    src/osd/windows/drawdd.c:992: error: 'MONITORINFOEX' has no member named 'rcMoni
    tor'
    src/osd/windows/drawdd.c:993: error: 'MONITORINFOEX' has no member named 'rcMoni
    tor'
    src/osd/windows/drawdd.c:994: error: 'MONITORINFOEX' has no member named 'rcMoni
    tor'
    src/osd/windows/drawdd.c: In function 'monitor_enum_callback':
    src/osd/windows/drawdd.c:1188: error: 'MONITORINFOEX' has no member named 'dwFla
    gs'
    make: *** [obj/windows/mame/osd/windows/drawdd.o] Error 1

     
    • Kai Tietz
      Kai Tietz
      2008-12-13

      No winuser.h defines MONITORINFOEX.

      Cheers,
      Kai

       
      • Kai Tietz
        Kai Tietz
        2008-12-13

        The issue could be, that you didn't installed the optional direct-x header set.

        Cheers,
        Kai

         
        • Zombiedeth
          Zombiedeth
          2008-12-13

          No i have the direct-x headers installed. I even tried with a process monitor installed and it's not showing any missing headers.

           
    • Kai Tietz
      Kai Tietz
      2008-12-15

      You need to add a 'mi.' before. The monitorinfoex structure is defined for w64 as
      typedef struct tagMONITORINFOEXA {
        MONITORINFO mi;
        CHAR szDevice[CCHDEVICENAME];
      } MONITORINFOEXA,*LPMONITORINFOEXA;

      Cheers,
      Kai

       
      • Zombiedeth
        Zombiedeth
        2008-12-15

        Thanks for looking into that but it is odd that the current code compiles fine as 64-bit using Microsofts Visual C++.

         
      • Zombiedeth
        Zombiedeth
        2009-03-29

        Using the mi. in the structure does seem to resolve the errors with MinGW64. The only problem is it doesn't seem to be valid usage in either official MinGW or Microsoft Visual C++.

        visual C++ 2008 (64bit)
        -------------------------------------------------------------------------
        Compiling src/osd/windows/drawdd.c...
        drawdd.c
        src\osd\windows\drawdd.c(991) : error C2039: 'mi' : is not a member of 'tagMONIT
        ORINFOEXW'
                C:\sdk\Include\winuser.h(10861) : see declaration of 'tagMONITORINFOEXW'

        src\osd\windows\drawdd.c(992) : error C2039: 'mi' : is not a member of 'tagMONIT
        ORINFOEXW'
                C:\sdk\Include\winuser.h(10861) : see declaration of 'tagMONITORINFOEXW'

        src\osd\windows\drawdd.c(993) : error C2039: 'mi' : is not a member of 'tagMONIT
        ORINFOEXW'
                C:\sdk\Include\winuser.h(10861) : see declaration of 'tagMONITORINFOEXW'

        src\osd\windows\drawdd.c(994) : error C2039: 'mi' : is not a member of 'tagMONIT
        ORINFOEXW'
                C:\sdk\Include\winuser.h(10861) : see declaration of 'tagMONITORINFOEXW'

        src\osd\windows\drawdd.c(1188) : error C2039: 'mi' : is not a member of 'tagMONI
        TORINFOEXW'
                C:\sdk\Include\winuser.h(10861) : see declaration of 'tagMONITORINFOEXW'

        make: *** [obj/windows/vmame/osd/windows/drawdd.o] Error 2
        -------------------------------------------------------------------------

        MinGW (32bit)
        -------------------------------------------------------------------------
        Compiling src/osd/windows/drawdd.c...
        src/osd/windows/drawdd.c: In function 'blit_to_primary':
        src/osd/windows/drawdd.c:991: error: 'MONITORINFOEX' has no member named 'mi'
        src/osd/windows/drawdd.c:992: error: 'MONITORINFOEX' has no member named 'mi'
        src/osd/windows/drawdd.c:993: error: 'MONITORINFOEX' has no member named 'mi'
        src/osd/windows/drawdd.c:994: error: 'MONITORINFOEX' has no member named 'mi'
        src/osd/windows/drawdd.c: In function 'monitor_enum_callback':
        src/osd/windows/drawdd.c:1188: error: 'MONITORINFOEX' has no member named 'mi'
        make: *** [obj/windows/mame/osd/windows/drawdd.o] Error 1

         
    • Kai Tietz
      Kai Tietz
      2009-03-29

      Hmm,
      well. I took a look into msdn and see the issue here:
      in msdn
      the structure is defined as

      typedef struct tagMONITORINFOEXA {
          MONITORINFO;
          CHAR szDevice[CCHDEVICENAME];
        } MONITORINFOEXA,*LPMONITORINFOEXA;

        typedef struct tagMONITORINFOEXW {
          MONITORINFO;
          WCHAR szDevice[CCHDEVICENAME];
        } MONITORINFOEXW,*LPMONITORINFOEXW;

      we define it as
      typedef struct tagMONITORINFOEXA {
          MONITORINFO mi;
          CHAR szDevice[CCHDEVICENAME];
        } MONITORINFOEXA,*LPMONITORINFOEXA;

        typedef struct tagMONITORINFOEXW {
          MONITORINFO mi;
          WCHAR szDevice[CCHDEVICENAME];
        } MONITORINFOEXW,*LPMONITORINFOEXW;

      in winuser.h.

      Could you test if the following change in winuser.h solves your issue?

      typedef struct tagMONITORINFOEXA {
          __extension__ MONITORINFO;
          CHAR szDevice[CCHDEVICENAME];
        } MONITORINFOEXA,*LPMONITORINFOEXA;

        typedef struct tagMONITORINFOEXW {
          __extension__  MONITORINFO;
          WCHAR szDevice[CCHDEVICENAME];
        } MONITORINFOEXW,*LPMONITORINFOEXW;

      Thanks,
      Kai

       
      • Zombiedeth
        Zombiedeth
        2009-03-29

        It still gives the original error with the change to winuser.h.

        Compiling src/osd/windows/drawdd.c...
        src/osd/windows/drawdd.c: In function 'blit_to_primary':
        src/osd/windows/drawdd.c:991: error: 'MONITORINFOEX' has no member named 'rcMoni
        tor'
        src/osd/windows/drawdd.c:992: error: 'MONITORINFOEX' has no member named 'rcMoni
        tor'
        src/osd/windows/drawdd.c:993: error: 'MONITORINFOEX' has no member named 'rcMoni
        tor'
        src/osd/windows/drawdd.c:994: error: 'MONITORINFOEX' has no member named 'rcMoni
        tor'
        src/osd/windows/drawdd.c: In function 'monitor_enum_callback':
        src/osd/windows/drawdd.c:1188: error: 'MONITORINFOEX' has no member named 'dwFla
        gs'
        make: *** [obj/windows/mame/osd/windows/drawdd.o] Error 1

         
        • Kai Tietz
          Kai Tietz
          2009-03-29

          Well, this incompatiblity of gcc to vc was the reason to name this structure field "mi".
          Does it helps here to replace the MONITORINFO in these structures by

            __extension__ struct {
            DWORD cbSize;
            RECT rcMonitor;
            RECT rcWork;
            DWORD dwFlags;
          };

          ?

           
          • Zombiedeth
            Zombiedeth
            2009-03-29

            Yes that change resolved the error.

             
            • Kai Tietz
              Kai Tietz
              2009-03-29

              Thanks for your tests and patient. I committed it revision 701.

              Cheers,
              Kai

               
            • Zombiedeth
              Zombiedeth
              2009-03-29

              Thanks alot for the help MAME is getting pretty close now it just has some linker errors that need to be tracked down.