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

Q_PROCESSOR_... defines are NOT available for moc compiler

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.6.0
    • Fix Version/s: 5.7.0
    • Component/s: Core: Other
    • Labels:
      None
    • Commits:
      36d524e6a3b64a8c35805c1b868d6d67ccae765c

      Description

      In qprocessordetection.h the processor definitions for x86 are defined as follows:

      #  if defined(_M_IX86)
      #    define Q_PROCESSOR_X86     (_M_IX86/100)
      #  elif defined(__i686__) || defined(__athlon__) || defined(__SSE__) || defined(__pentiumpro__)
      #    define Q_PROCESSOR_X86     6
      #  elif defined(__i586__) || defined(__k6__) || defined(__pentium__)
      #    define Q_PROCESSOR_X86     5
      #  elif defined(__i486__) || defined(__80486__)
      #    define Q_PROCESSOR_X86     4
      #  else
      #    define Q_PROCESSOR_X86     3
      #  endif
      

       

      defines like _i686_ are defined by compiler. This means that the define is not available for the moc compiler. If you want to compile for X86 and you have a construct like this

      #ifndef Q_PROCESSOR_X86

      private slots:

      void doSomeNonX86Things(void);

      #endif

      for moc compiler slot doSomeNonX86Things is part of the code (because Q_PROCESSOR_X86 is not defined) and for X86 compiler method doSomeNonX86Things ist NOT part of the code (because Q_PROCESSOR_X86 is defined). In this case code could not be compiled for X86.

       

        Attachments

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

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            danhauck Daniel Hauck
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes