Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8466

Compile error in qglobal.cpp under Cygwin

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.7.0
    • 4.6.2
    • Other
    • None
    • Windows Vista 64
      Cygwin 1.7.1

    Description

      Hi,

      Qt/src/corelib/global/qglobal.cpp fails to compile under Cygwin:

      QSysInfo::WinVersion QSysInfo::windowsVersion()
      {
          // snip
          OSVERSIONINFOW osver;
          osver.dwOSVersionInfoSize = sizeof(osver);
          GetVersionEx(&osver);
      

      This fails because it is passing a wide character variant of the version structure to a normal GetVersionEx(), which can either be wide character or ANSI. Instead it should either use OSVERSIONINFO or GetVersionExW() to avoid mixing. Possibly you could also #define UNICODE, but that seems like a hacky solution.

      Also see the documentation here: http://msdn.microsoft.com/en-us/library/ms724451%28VS.85%29.aspx, and the definitions in winbase.h and winnt.h.

      Thanks,
      Benbuck

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            fernenge Harald Fernengel
            bnason_nf Benbuck Nason
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes