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

dumpcpp uses "-n" option value for guard macros

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 4.8.0
    • 4.7.0
    • ActiveX Support
    • None
    • f3f4e93f482c1ff579cb78cc1765a6930de3d766

      dumpcpp uses "-n" option value for guard macros in headers which is wrong because that implies that every QtAx COM wrapper must have a unique namespace so that one cpp file could include several headers at same time. File names should be used for include guards.

      My paritcular case is using OPOS device drivers which are located in its own file by device type plus one common file with constants, like this:

      Opos_Constants.dll 
      OPOSPointCardRW.ocx 
      OPOSPOSKeyboard.ocx 
      OPOSPOSPower.ocx 
      OPOSPOSPrinter.ocx 
      OPOSRFIDScanner.ocx 
      ... 
      

      It's natural that they all should get in the same C++ namespace and at least two files (constants and any other driver) are included simultaneously.

      I use these commands:
      dumpcpp OPOS\CommonCO\OPOSBelt.ocx -n OPOS -o OPOS\QtWrappers\Belt 
      dumpcpp OPOS\CommonCO\OPOSBillAcceptor.ocx -n OPOS -o OPOS\QtWrappers\BillAcceptor 
      dumpcpp OPOS\CommonCO\OPOSBillDispenser.ocx -n OPOS -o OPOS\QtWrappers\BillDispenser 
      

      and every header has this:

      /**************************************************************************** 
      ** 
      ** Namespace OPOS generated by dumpcpp from type library 
      ** OPOS\CommonCO\OPOSBelt.ocx 
      ** 
      ****************************************************************************/ 
      
      #ifndef QAX_DUMPCPP_OPOS_H 
      #define QAX_DUMPCPP_OPOS_H 
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ wrong
      

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

            mpejcoch Martin Pejcoch (Inactive)
            mpejcoch Martin Pejcoch (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes