]> Creatis software - gdcm.git/blob - src/gdcmCommon.h
* Memory leak hunt with the following command:
[gdcm.git] / src / gdcmCommon.h
1 //gdcmCommon.h
2 //-----------------------------------------------------------------------------
3 #ifndef GDCMCOMMON_H
4 #define GDCMCOMMON_H
5
6 #include "gdcmConfigure.h"
7
8 //-----------------------------------------------------------------------------
9 //This is needed when compiling in debug mode
10 #ifdef _MSC_VER
11 // 'identifier' : class 'type' needs to have dll-interface to be used by
12 // clients of class 'type2'
13 #pragma warning ( disable : 4251 )
14 // 'identifier' : identifier was truncated to 'number' characters in the
15 // debug information
16 #pragma warning ( disable : 4786 )
17 //'identifier' : decorated name length exceeded, name was truncated
18 #pragma warning ( disable : 4503 )
19 // C++ exception specification ignored except to indicate a 
20 // function is not __declspec(nothrow)
21 #pragma warning ( disable : 4290 )
22 // signed/unsigned mismatch
23 #pragma warning ( disable : 4018 )
24 // return type for 'identifier' is '' (ie; not a UDT or reference to UDT. Will
25 // produce errors if applied using infix notation
26 #pragma warning ( disable : 4284 )
27 // 'type' : forcing value to bool 'true' or 'false' (performance warning)
28 // //#pragma warning ( disable : 4800 )
29 #endif //_MSC_VER
30
31 //-----------------------------------------------------------------------------
32 #ifdef __GNUC__
33 #ifndef HAVE_NO_STDINT_H
34 #include <stdint.h>
35 #define guint16 uint16_t
36 #define guint32 uint32_t
37 #define gint16  int16_t
38 #define gint32  int32_t
39 #else
40 typedef  unsigned short guint16;
41 typedef  unsigned int   guint32;
42 typedef  short          gint16;
43 typedef  int            gint32;
44 #define UINT32_MAX    (4294967295U)
45 #endif //HAVE_NO_STDINT_H
46 #endif
47
48 #ifdef _MSC_VER 
49 typedef  unsigned short guint16;
50 typedef  unsigned int   guint32;
51 typedef  short          gint16;
52 typedef  int            gint32;
53 #define UINT32_MAX    (4294967295U)
54 #endif
55
56 #ifdef _MSC_VER
57 #define GDCM_EXPORT __declspec( dllexport )
58 #define getcwd _getcwd
59 #else
60 #define GDCM_EXPORT
61 #endif
62
63 // ifdef for old gcc / broken compiler
64 #ifdef GDCM_NO_ANSI_STRING_STREAM
65 #  include <strstream>
66 #  define  ostringstream ostrstream
67 # else
68 #  include <sstream>
69 #endif
70
71
72 // Centralize information about the gdcm dictionary in only one file:
73 #ifndef PUB_DICT_PATH
74 #  define PUB_DICT_PATH   "../Dicts/"
75 #endif
76 #define PUB_DICT_NAME     "DicomV3Dict"
77 #define PUB_DICT_FILENAME "dicomV3.dic"
78 #define DICT_ELEM         "DicomDir.dic"
79 #define DICT_TS           "dicomTS.dic"
80 #define DICT_VR           "dicomVR.dic"
81
82 #include <string>
83
84 const std::string GDCM_UNFOUND = "gdcm::Unfound";   /// MEMORY LEAK
85
86 typedef std::string TagKey;
87 typedef std::string TagName;
88
89 enum FileType {
90       gdcmUnknown = 0,
91       gdcmExplicitVR, // gdcmDicomDir is in this case
92       gdcmImplicitVR,
93       gdcmACR,
94       gdcmACR_LIBIDO
95 };
96
97 //-----------------------------------------------------------------------------
98 #endif