Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-536

Shiboken: #pragma once not recognized as include guard

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 5.6
    • Shiboken

    Description

      I'm using shiboken to wrap my own classes. After recent changes to ApiExtractor I started to having  issues with a lot of duplicate entries generated for wrapper objects.

      eg:

      #define SBK_QTWMRELEASECACHINGPOLICY_IDX 10
      #define SBK_QTWMWRAPPERAREATYPE_IDX 12
      #define SBK_QTWMTOOLTYPE_IDX 11
      #define SBK_QTWMRELEASECACHINGPOLICY_IDX 10
      #define SBK_QTWMWRAPPERAREATYPE_IDX 12
      #define SBK_QTWMTOOLTYPE_IDX 11
      #define SBK_QTWMRELEASECACHINGPOLICY_IDX 10
      #define SBK_QTWMWRAPPERAREATYPE_IDX 12
      #define SBK_QTWMTOOLTYPE_IDX 11
      #define SBK_QTWMRELEASECACHINGPOLICY_IDX 10
      // ...
      template<> inline PyTypeObject* SbkType< ::QTWMReleaseCachingPolicy >() { return Sbk_CryQtTypes[SBK_QTWMRELEASECACHINGPOLICY_IDX]; }
      template<> inline PyTypeObject* SbkType< ::QTWMWrapperAreaType >() { return Sbk_CryQtTypes[SBK_QTWMWRAPPERAREATYPE_IDX]; }
      template<> inline PyTypeObject* SbkType< ::QTWMToolType >() { return Sbk_CryQtTypes[SBK_QTWMTOOLTYPE_IDX]; }
      
      // duplicate methods in classes
      inline void closeEvent_protected(QCloseEvent * arg__1) { QCustomWindowFrame::closeEvent(arg__1); }
      virtual void closeEvent(QCloseEvent * arg__1);
      inline void closeEvent_protected(QCloseEvent * arg__1) { QCustomWindowFrame::closeEvent(arg__1); }
      virtual void closeEvent(QCloseEvent * arg__1);

      I finally tried to dig into it, and it seems that #pragma once is not used as an include guard. 

      After changing some headers to use classic include guards generator worked perfectly.

      However since I'm wrapping small part of much bigger project that uses #pragma once as a rule, it is not possible for me to use classic include guards in the codebase.

       

      Attachments

        Issue Links

          Activity

            People

              kleint Friedemann Kleint
              zwadar Roman Zawada
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: