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

Shiboken: #pragma once not recognized as include guard

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.6
    • Fix Version/s: None
    • Component/s: Shiboken
    • Labels:

      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

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

          Activity

            People

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes