Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004177 [JEDI VCL] 00 JVCL Components minor always 2007-07-11 06:56 2007-07-11 13:18
Reporter Oleg View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version 3.32
Summary 0004177: JvThemes.pas generated header file is "incompatible" with some third party libraries
Description Usage of unit "JvThemes" and its header file "JvThemes.hpp" is not possibe in C++ units if some third party libraries also used (ThemeSrv, Raize Components) - because constants "teButton" ... "twSmallFrameBottomSizingTemplate" declared differently, using enums (ThemeSrv, Raize) and using "#define" (in JVCL).

For example:
  ----------------------------------------------------------------------------
  file "RzThemeSrv.hpp" (from Raize 4.0.1):
  ...
  enum TThemedElement { teButton, teClock, teComboBox, teEdit, teExplorerBar, teHeader, teListView, teMenu, tePage, teProgress, teRebar, teScrollBar, teSpin, teStartPanel, teStatus, teTab, teTaskBand, teTaskBar, teToolBar, teToolTip, teTrackBar, teTrayNotify, teTreeview, teWindow };
  ...
  ----------------------------------------------------------------------------
  compiler errors:

  [C++ Error] RzThemeSrv.hpp(29): E2184 Enum syntax error
    Full parser context
      ...
      ...: #include ...\RzDBStat.hpp
      RzDBStat.hpp(13): #include ...\RzCommon.hpp
      RzCommon.hpp(17): #include ...\RzThemeSrv.hpp
      RzThemeSrv.hpp(26): namespace Rzthemesrv

  [C++ Error] RzThemeSrv.hpp(29): E2040 Declaration terminated incorrectly
    Full parser context
      ...
      ...: #include ...\RzDBStat.hpp
      RzDBStat.hpp(13): #include ...\RzCommon.hpp
      RzCommon.hpp(17): #include ...\RzThemeSrv.hpp
      RzThemeSrv.hpp(26): namespace Rzthemesrv

  [C++ Error] RzThemeSrv.hpp(29): E2190 Unexpected }
    Full parser context
      ...
      ...: #include ...\RzDBStat.hpp
      RzDBStat.hpp(13): #include ...\RzCommon.hpp
      RzCommon.hpp(17): #include ...\RzThemeSrv.hpp
  ----------------------------------------------------------------------------


This occured because unit "JvThemes.pas" declares constants such as:
  ----------------------------------------------------------------------------
    const
      teButton = {$IFDEF COMPILER7_UP}Themes{$ELSE}ThemeSrv{$ENDIF}.teButton;
    ...
    twSmallFrameBottomSizingTemplate =
      {$IFDEF COMPILER7_UP}Themes{$ELSE}ThemeSrv{$ENDIF}.twSmallFrameBottomSizingTemplate;
  ----------------------------------------------------------------------------
which are then "translated" into header file as:
  ----------------------------------------------------------------------------
  #define teButton (Themesrv::TThemedElement)(0)
  ...
  #define twSmallFrameBottomSizingTemplate (Themesrv::TThemedWindow)(116)
  ----------------------------------------------------------------------------
- the generated header file contains such declarations using "#define" directive, that leads to the conflict in later C++ declarations.
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0013563)
obones (administrator)
2007-07-11 07:02

The HPP files are generated by the compiler itself, we can't do much about that.

And you could change the order of include files and get sorted.
(0013565)
AHUser (developer)
2007-07-11 13:17

C++Builder 2007 generates
static const Themes::TThemedElement teButton = (Themes::TThemedElement)(0);

Despite this I have added the {$EXTERNALSYM xxx} for every enum alias.

- Issue History
Date Modified Username Field Change
2007-07-11 06:56 Oleg New Issue
2007-07-11 07:02 obones Note Added: 0013563
2007-07-11 07:02 obones Status new => feedback
2007-07-11 13:17 AHUser Status feedback => resolved
2007-07-11 13:17 AHUser Fixed in Version => Daily / SVN
2007-07-11 13:17 AHUser Resolution open => fixed
2007-07-11 13:17 AHUser Assigned To => AHUser
2007-07-11 13:17 AHUser Note Added: 0013565


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker