]> Creatis software - gdcm.git/commitdiff
BUG: Solve -hopefully- problem on MacOSX where gdcm seemed to stop working. More...
authormalaterre <malaterre>
Sun, 9 Jan 2005 00:13:26 +0000 (00:13 +0000)
committermalaterre <malaterre>
Sun, 9 Jan 2005 00:13:26 +0000 (00:13 +0000)
ChangeLog
src/gdcmCommon.h
src/gdcmGlobal.cxx
src/gdcmUtil.cxx

index 8633608d593629cb67e7b8bf53b3c656c2a1fd4c..bd61591340ea1eb57b32a1222930f579047b90ad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-08 Mathieu Malaterre  <Mathieu.Malaterre@creatis.insa-lyon.fr>
+   * Fix bug on MacOSX with static initialization in a multui threaded
+        environement. static const string in a header file used to be ill
+        initialized provoquing the freeze of any tests. patch should solve this
+        issue.
+
 2005-01-08 Jean-Pierre Roux <jpr@creatis.univ-lyon1.fr>
    * According to Benoit's suggestion, and without any objection from anybody
       - methods SetxxxByNumber and GetxxxByNumber renamed as Setxxx and Getxxx
index d9dab0a8b8a2f5668d1aafa07acc64095434d6eb..ee2ef9ddd4691cc07496a88d57a71412596d038a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmCommon.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/08 23:14:05 $
-  Version:   $Revision: 1.45 $
+  Date:      $Date: 2005/01/09 00:13:26 $
+  Version:   $Revision: 1.46 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -78,11 +78,11 @@ namespace gdcm
 #define DICT_TS           "dicomTS.dic"
 #define DICT_VR           "dicomVR.dic"
 
-static const std::string GDCM_UNKNOWN   = "gdcm::Unknown";
-static const std::string GDCM_UNFOUND   = "gdcm::Unfound";
-static const std::string GDCM_BINLOADED = "gdcm::Binary data loaded";
-static const std::string GDCM_NOTLOADED = "gdcm::NotLoaded";
-static const std::string GDCM_UNREAD    = "gdcm::UnRead";
+extern const std::string GDCM_UNKNOWN;
+extern const std::string GDCM_UNFOUND;
+extern const std::string GDCM_BINLOADED;
+extern const std::string GDCM_NOTLOADED;
+extern const std::string GDCM_UNREAD;
 
 /// \brief TagKey is made to hold an "universal" (as in URL, Universal
 ///        Ressource Locator)  key to a DocEntry i.e. a dicom tag.
index fdcb4181efe063834fb0a39da62ce720a0db4974..e5597cb93db998d1a0cfd12ff98ad4400d29a0ab 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmGlobal.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/07 22:03:30 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2005/01/09 00:13:26 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 namespace gdcm 
 {
 
+// Those global string that are return by reference everywhere in gdcm code
+// used to be in gdcmCommon.h but due to a 'bug' in gcc/MacOSX
+// you cannot have static initialization in a multithreaded environment
+// since there is a lazy construction everything got skrew up somehow
+// Therefore the actual initiliazation is done in a cxx file (avoid
+// duplicated symbol), and an extern is used in gdcmCommon.h
+const std::string GDCM_UNKNOWN   = "gdcm::Unknown";
+const std::string GDCM_UNFOUND   = "gdcm::Unfound";
+const std::string GDCM_BINLOADED = "gdcm::Binary data loaded";
+const std::string GDCM_NOTLOADED = "gdcm::NotLoaded";
+const std::string GDCM_UNREAD    = "gdcm::UnRead";
+  
 /**
  * \ingroup Globals
  * \brief Pointer to a container, holding _all_ the Dicom Dictionaries.
index c56e707b41ab74d2bac047a2f984fbb81448ba17..ccdb3cb4e1232ea21a1c5294341b5a7586919d08 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmUtil.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/08 23:00:23 $
-  Version:   $Revision: 1.85 $
+  Date:      $Date: 2005/01/09 00:13:26 $
+  Version:   $Revision: 1.86 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -366,9 +366,7 @@ typedef BOOL(WINAPI * pSnmpExtensionInitEx) (
 #endif
 
 #ifdef __APPLE__
-
 #include <CoreFoundation/CoreFoundation.h>
-
 #include <IOKit/IOKitLib.h>
 #include <IOKit/network/IOEthernetInterface.h>
 #include <IOKit/network/IONetworkInterface.h>