]> Creatis software - gdcm.git/commitdiff
ENH: gdcm now compiles on borland
authormalaterre <malaterre>
Tue, 9 Nov 2004 21:55:54 +0000 (21:55 +0000)
committermalaterre <malaterre>
Tue, 9 Nov 2004 21:55:54 +0000 (21:55 +0000)
15 files changed:
Example/BuildUpDicomDir.cxx
Example/FindTags.cxx
Example/TestDcm2Acr.cxx
Example/makeDicomDir.cxx
Testing/TestAllReadCompareDicom.cxx
src/CMakeLists.txt
src/gdcmCommon.h
src/gdcmDicomDir.cxx
src/gdcmDirList.cxx
src/gdcmDocument.cxx
src/gdcmHeader.cxx
src/gdcmJpeg12.cxx
src/gdcmJpeg16.cxx
src/gdcmJpeg8.cxx
src/gdcmPixelConvert.cxx

index 0f84a44..7429a33 100644 (file)
 #include <errno.h>
 
 // for Directory pb
-#ifdef _MSC_VER 
+#if defined(_MSC_VER) || defined(__BORLANDC__) 
    #include <windows.h> 
    #include <direct.h>
+   #include <stdio.h>
 #else
    #include <dirent.h>   
    #include <unistd.h>
index 20a3d52..1b3ece2 100644 (file)
@@ -1,6 +1,7 @@
 #include <iostream>
 #include "gdcm.h"
 #include "math.h"
+#include <stdio.h>
 
 int main(int argc, char* argv[]) {  
 
index 59282f0..87d6250 100644 (file)
@@ -1,5 +1,6 @@
 #include <iostream>
 #include "gdcm.h"
+#include <stdio.h>
 
 int main(int argc, char* argv[])
 {  
index cc9804f..8d8e3e1 100644 (file)
@@ -5,31 +5,6 @@
 #include "gdcmDicomDirPatient.h"
 #include "gdcmDirList.h"
 
-#include <fstream>
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-#  include <strstream>
-#  define  ostringstream ostrstream
-# else
-#  include <sstream>
-#endif
-
-#define  ostringstream ostrstream
-
-#include <sys/types.h>
-#include <errno.h>
-
-// for Directory pb
-#ifdef _MSC_VER 
-   #include <windows.h> 
-   #include <direct.h>
-#else
-   #include <dirent.h>   
-   #include <unistd.h>
-#endif
-
-#include <vector>
-#include <algorithm>
-
 // ---
 void StartMethod(void *toto) {
   (void)toto;
index a61581d..a4690f1 100644 (file)
@@ -1,5 +1,6 @@
 #include "gdcmHeader.h"
 #include "gdcmFile.h"
+#include <stdio.h>
 
 //Generated file:
 #include "gdcmDataImages.h"
index 5be4a21..97dad5e 100644 (file)
@@ -52,20 +52,16 @@ SET(libgdcm_la_SOURCES
    )
 
 ADD_LIBRARY(gdcm ${libgdcm_la_SOURCES} )
-IF(UNIX)
-  TARGET_LINK_LIBRARIES(gdcm 
-    gdcmjpeg8 
-    gdcmjpeg12
-    gdcmjpeg16
-  )
-ELSE(UNIX)
-  TARGET_LINK_LIBRARIES(gdcm 
-    gdcmjpeg8 
-    gdcmjpeg12
-    gdcmjpeg16
-    Wsock32.lib   #doesn't exist on cygwin
-  )
-ENDIF(UNIX)
+TARGET_LINK_LIBRARIES(gdcm 
+  gdcmjpeg8 
+  gdcmjpeg12
+  gdcmjpeg16
+)
+IF(WIN32)
+  IF(NOT BORLAND)
+    TARGET_LINK_LIBRARIES(gdcm Wsock32)
+  ENDIF(NOT BORLAND)
+ENDIF(WIN32)
 
 #The following is not working because when a header file is not found it tries 
 #to find one in the binary dir
index 5d1c9b1..62a71b7 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmCommon.h,v $
   Language:  C++
-  Date:      $Date: 2004/11/03 20:52:13 $
-  Version:   $Revision: 1.38 $
+  Date:      $Date: 2004/11/09 21:55:55 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -57,7 +57,7 @@ typedef  unsigned int   uint32_t;
 #endif //HAVE_NO_STDINT_H
 #endif
 
-#ifdef _MSC_VER 
+#if defined( _MSC_VER) || defined(__BORLANDC__)
 typedef    signed char   int8_t;
 typedef  unsigned char  uint8_t;
 typedef  unsigned short uint16_t;
@@ -65,13 +65,16 @@ typedef  unsigned int   uint32_t;
 #define UINT32_MAX    (4294967295U)
 #endif
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__BORLANDC__)
 #define GDCM_EXPORT __declspec( dllexport )
-#define getcwd _getcwd
 #else
 #define GDCM_EXPORT
 #endif
 
+#ifdef _MSC_VER
+#define getcwd _getcwd
+#endif
+
 // ifdef for old gcc / broken compiler
 #ifdef GDCM_NO_ANSI_STRING_STREAM
 #  include <strstream>
index b7f4cb0..2fef35c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/03 20:52:13 $
-  Version:   $Revision: 1.77 $
+  Date:      $Date: 2004/11/09 21:55:55 $
+  Version:   $Revision: 1.78 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -34,7 +34,7 @@
 #include <algorithm>
 #include <sys/types.h>
 
-#ifdef _MSC_VER 
+#if defined( _MSC_VER) || defined(__BORLANDC__)
    #include <direct.h>
 #else
    #include <unistd.h>
index d4d0c2d..0420c80 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDirList.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/27 23:03:07 $
-  Version:   $Revision: 1.25 $
+  Date:      $Date: 2004/11/09 21:55:55 $
+  Version:   $Revision: 1.26 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -22,9 +22,9 @@
 #include <iostream>
 #include <algorithm>
 
-#if defined(_MSC_VER) || defined (__CYGWIN__)
+#if defined(_MSC_VER) || defined (__CYGWIN__) || defined(__BORLANDC__)
    #include <windows.h> 
-#ifdef _MSC_VER
+#if defined _MSC_VER || defined(__BORLANDC__)
    #include <direct.h>
 #endif //_MSC_VER
 #else
@@ -91,7 +91,7 @@ int DirList::Explore(std::string const & dirpath, bool recursive)
    int numberOfFiles = 0;
    std::string fileName;
    std::string dirName = Util::NormalizePath(dirpath);
-#if defined(_MSC_VER) || defined(__CYGWIN__)
+#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__BORLANDC__)
    WIN32_FIND_DATA fileData; 
    HANDLE hFile=FindFirstFile((dirName+"*").c_str(),&fileData);
    int found = true;
index ab150ec..289bf43 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/05 21:23:46 $
-  Version:   $Revision: 1.118 $
+  Date:      $Date: 2004/11/09 21:55:55 $
+  Version:   $Revision: 1.119 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -28,7 +28,7 @@
 #include <iomanip>
 
 // For nthos:
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__BORLANDC__)
    #include <winsock.h>
 #else
    #include <netinet/in.h>
@@ -2388,7 +2388,7 @@ bool Document::CheckSwap()
    uint32_t  s32;
    uint16_t  s16;
        
-   char deb[HEADER_LENGTH_TO_READ];
+   char deb[256]; //HEADER_LENGTH_TO_READ];
     
    // First, compare HostByteOrder and NetworkByteOrder in order to
    // determine if we shall need to swap bytes (i.e. the Endian type).
index ed7402e..13e90a3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/05 20:23:14 $
-  Version:   $Revision: 1.198 $
+  Date:      $Date: 2004/11/09 21:55:55 $
+  Version:   $Revision: 1.199 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -22,6 +22,7 @@
 #include "gdcmDebug.h"
 #include "gdcmTS.h"
 #include "gdcmValEntry.h"
+#include <stdio.h>
 
 #include <vector>
 
index 3be3868..9e2dc35 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJpeg12.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/08 20:05:52 $
-  Version:   $Revision: 1.26 $
+  Date:      $Date: 2004/11/09 21:55:56 $
+  Version:   $Revision: 1.27 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -16,6 +16,7 @@
                                                                                 
 =========================================================================*/
 #include "gdcmFile.h"
+#include <stdio.h>
 
 extern "C" {
 #include "gdcmjpeg/12/jconfig.h"
index a0c96ac..08575f8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJpeg16.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/08 20:05:52 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2004/11/09 21:55:56 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -16,6 +16,7 @@
                                                                                 
 =========================================================================*/
 #include "gdcmFile.h"
+#include <stdio.h>
 
 extern "C" {
 #include "gdcmjpeg/16/jconfig.h"
index bd6aec7..e96a6d3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJpeg8.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/08 20:05:52 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2004/11/09 21:55:56 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -16,6 +16,7 @@
                                                                                 
 =========================================================================*/
 #include "gdcmFile.h"
+#include <stdio.h>
 
 extern "C" {
 #include "gdcmjpeg/8/jconfig.h"
index f6f59d0..a4277a7 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/08 22:13:40 $
-  Version:   $Revision: 1.25 $
+  Date:      $Date: 2004/11/09 21:55:56 $
+  Version:   $Revision: 1.26 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -25,6 +25,7 @@
 #include "gdcmDebug.h"
 #include "gdcmPixelConvert.h"
 #include <fstream>
+#include <stdio.h>
 
 namespace gdcm
 {