GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Fairroot » General Discussion » FairRoot global name conflicts
FairRoot global name conflicts [message #24390] Mon, 14 October 2019 18:17
Waleed Esmail is currently offline  Waleed Esmail
Messages: 9
Registered: March 2018
occasional visitor
From: *ext.kfa-juelich.de
Dear FairRoot developers,

I am working on an external library that depends on FairRoot. Apparently there was a problem of naming conflicts of global variables in the library and the enum FairLogLevel from FairLogger.

We've solved this problem by putting FairLogLevel inside class scope enum class FairLogLevel and FATAL=0, ...

-enum FairLogLevel
+
+enum class FairLogLevel
 {
-    FATAL,
+    FATAL=0,
.
.
.

-    const char* ConvertLogLevelToString(FairLogLevel level) const { return LogLevelString[level]; }
+    const char* ConvertLogLevelToString(FairLogLevel level) const { return LogLevelString[static_cast<int>(level)]; }


So it would be great to have this in the dev branch and the upcoming release to avoid potential conflicts.

Kind Regards,
Yong & Waleed
FZJ

[Updated on: Mon, 14 October 2019 18:20]

Report message to a moderator

Previous Topic: Force to compile with C++17 standards
Next Topic: Add two similar files as friends in the simulation
Goto Forum:
  


Current Time: Sun Dec 01 05:16:34 CET 2024

Total time taken to generate the page: 0.00685 seconds