]> Creatis software - gdcm.git/blob - src/gdcmCommon.h
2004-04-28 Jean-Pierre Roux
[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 //#if defined __STDC_LIMIT_MACROS
35 //#endif
36 #include <stdint.h>
37 //#ifdef UINT32_MAX
38 //#error hehrehhehehehe2
39 //#endif
40 #define guint16 uint16_t
41 #define guint32 uint32_t
42 #define gint16  int16_t
43 #define gint32  int32_t
44 #else
45 typedef  unsigned short guint16;
46 typedef  unsigned int   guint32;
47 typedef  short          gint16;
48 typedef  int            gint32;
49 #define UINT32_MAX    (4294967295U)
50 #endif //HAVE_NO_STDINT_H
51 #endif
52
53 #ifdef _MSC_VER 
54 typedef  unsigned short guint16;
55 typedef  unsigned int   guint32;
56 typedef  short          gint16;
57 typedef  int            gint32;
58 #define UINT32_MAX    (4294967295U)
59 #endif
60
61 #ifdef _MSC_VER
62 #define GDCM_EXPORT __declspec( dllexport )
63 #define getcwd _getcwd
64 #else
65 #define GDCM_EXPORT
66 #endif
67
68 // ifdef for old gcc / broken compiler
69 #ifdef GDCM_NO_ANSI_STRING_STREAM
70 #  include <strstream>
71 #  define  ostringstream ostrstream
72 # else
73 #  include <sstream>
74 #endif
75
76
77 // Centralize information about the gdcm dictionary in only one file:
78 #ifndef PUB_DICT_PATH
79 #  define PUB_DICT_PATH   "../Dicts/"
80 #endif
81 #define PUB_DICT_NAME     "DicomV3Dict"
82 #define PUB_DICT_FILENAME "dicomV3.dic"
83 #define DICT_ELEM         "DicomDir.dic"
84 #define DICT_TS           "dicomTS.dic"
85 #define DICT_VR           "dicomVR.dic"
86
87 #include <string>
88
89 const std::string GDCM_UNFOUND = "gdcm::Unfound";
90
91 typedef std::string TagKey;
92 typedef std::string TagName;
93
94 enum FileType {
95       Unknown = 0,
96       ExplicitVR, // gdcmDicomDir is in this case
97       ImplicitVR,
98       ACR,
99       ACR_LIBIDO
100 };
101
102 //-----------------------------------------------------------------------------
103 #endif