D5866: ecm_qt_declare_logging_category(): more unique include guard for header

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Mon May 15 14:52:03 UTC 2017


kossebau created this revision.
Restricted Application added projects: Frameworks, Build System.

REVISION SUMMARY
  The old guard was created just from the identifier + _H, which runs the
  chance to clash in projects which use an identifier matching the project
  name and which also have a class or central file header which is named
  by the project and then has an include guard matching the filename.
  Example:
  project ABC -> abc.h with ABC_H guard
  identifier ABC, header debug.h -> debug.h with ABC_H guard
  any.cpp including both abc.h and debug.h will see only one content
  
  Using both the header file name and identifier for the guard name
  and prefixing it additionally with a macro specific term should make
  the guard both follow the usual pattern for guards matching the
  file name and also add some namespacing to allow for similar named
  header files in bigger projects (e.g. "debug.h") which could be
  included in the same include tree.

REPOSITORY
  R240 Extra CMake Modules

BRANCH
  improveqtlogdeclareheaderguard

REVISION DETAIL
  https://phabricator.kde.org/D5866

AFFECTED FILES
  modules/ECMQtDeclareLoggingCategory.cmake

To: kossebau, #frameworks, #build_system
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20170515/d6dc4eee/attachment.html>


More information about the Kde-buildsystem mailing list