From: malaterre Date: Sat, 16 Apr 2005 03:50:26 +0000 (+0000) Subject: CONP: Alrite seems like that before gcc 2.96 ios::failure was not defined. I could... X-Git-Tag: Version1.2.bp~778 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9835a0e10786c0ba67194217ddc97ee00e89d00d;p=gdcm.git CONP: Alrite seems like that before gcc 2.96 ios::failure was not defined. I could only find ref to ios_base::failure. This thing is really poorly documented my guess is that this is not really in c++ but just a stupid extension --- diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index e5de6788..53cf29a2 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllReadCompareDicom.cxx,v $ Language: C++ - Date: $Date: 2005/04/15 21:46:06 $ - Version: $Revision: 1.36 $ + Date: $Date: 2005/04/16 03:50:26 $ + Version: $Revision: 1.37 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,7 +20,6 @@ #include "gdcmFileHelper.h" #include -#include //Generated file: #include "gdcmDataImages.h" @@ -76,19 +75,19 @@ private: bool WriteFileData(std::ofstream *fp); uint8_t ReadInt8 (std::ifstream *fp) -#ifndef __GNUC__ - throw( std::ofstream::failure ); +#if !(__GNUC__==2 && __GNUC_MINOR__<=96) + throw( std::ios::failure ); #else ; #endif uint16_t ReadInt16(std::ifstream *fp) -#ifndef __GNUC__ +#if !(__GNUC__==2 && __GNUC_MINOR__<=96) throw( std::ios::failure ); #else ; #endif uint32_t ReadInt32(std::ifstream *fp) -#ifndef __GNUC__ +#if !(__GNUC__==2 && __GNUC_MINOR__<=96) throw( std::ios::failure ); #else ; @@ -307,13 +306,13 @@ bool TestFile::WriteFileData(std::ofstream *fp) } uint8_t TestFile::ReadInt8 (std::ifstream *fp) -#ifndef __GNUC__ +#if !(__GNUC__==2 && __GNUC_MINOR__<=96) throw( std::ios::failure ) #endif { uint8_t g; fp->read ((char*)&g, (size_t)1); -#ifndef __GNUC__ +#if !(__GNUC__==2 && __GNUC_MINOR__<=96) if ( fp->fail() ) throw std::ios::failure( "TestFile::ReadInt8() - file error." ); if( fp->eof() ) @@ -323,13 +322,13 @@ uint8_t TestFile::ReadInt8 (std::ifstream *fp) } uint16_t TestFile::ReadInt16(std::ifstream *fp) -#ifndef __GNUC__ +#if !(__GNUC__==2 && __GNUC_MINOR__<=96) throw( std::ios::failure ) #endif { uint16_t g; fp->read ((char*)&g, (size_t)2); -#ifndef __GNUC__ +#if !(__GNUC__==2 && __GNUC_MINOR__<=96) if ( fp->fail() ) throw std::ios::failure( "TestFile::ReadInt16() - file error." ); if( fp->eof() ) @@ -343,13 +342,13 @@ uint16_t TestFile::ReadInt16(std::ifstream *fp) } uint32_t TestFile::ReadInt32(std::ifstream *fp) -#ifndef __GNUC__ +#if !(__GNUC__==2 && __GNUC_MINOR__<=96) throw( std::ios::failure ) #endif { uint32_t g; fp->read ((char*)&g, (size_t)4); -#ifndef __GNUC__ +#if !(__GNUC__==2 && __GNUC_MINOR__<=96) if ( fp->fail() ) throw std::ios::failure( "TestFile::ReadInt32() - file error." ); if( fp->eof() ) @@ -578,7 +577,7 @@ int TestAllReadCompareDicom(int argc, char *argv[]) ////// Check for existence of reference baseline directory std::string baseLineDir = GDCM_DATA_ROOT; - baseLineDir += "/BaselineDicom"; + baseLineDir += "/BaselineDicom/"; if( !gdcm::DirList::IsDirectory(baseLineDir) ) { @@ -595,7 +594,6 @@ int TestAllReadCompareDicom(int argc, char *argv[]) filename += "/"; filename += gdcmDataImages[i]; - baseLineDir += '/'; std::string referenceFileName = baseLineDir + gdcmDataImages[i++]; std::string::size_type slash_pos = referenceFileName.rfind( "." ); if( slash_pos != std::string::npos )