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: 5
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

 
Read Message
Previous Topic: Force to compile with C++17 standards
Goto Forum:
  


Current Time: Thu Nov 21 04:53:08 CET 2019

Total time taken to generate the page: 0.01943 seconds