00001 /* 00002 * 00003 * Copyright (C) 1997-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: ofstd 00019 * 00020 * Author: Marco Eichelberg 00021 * 00022 * Purpose: encapsulation of old style vs. ISO C++ standard includes 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:06:05 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/ofstd/include/dcmtk/ofstd/ofstdinc.h,v $ 00027 * CVS/RCS Revision: $Revision: 1.11 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 // this file is not and should not be protected against multiple inclusion 00035 00036 #include "dcmtk/config/osconfig.h" 00037 00038 #ifdef HAVE_STD_NAMESPACE 00039 namespace std { } 00040 using namespace std; 00041 #endif 00042 00043 /* Header files as defined in ISO/IEC 14882:1998, Section 17.4.1.2, Table 11 00044 * These are header files for the Standard C++ Library. 00045 */ 00046 00047 // define INCLUDE_ALGORITHM to include "ofalgo.h" 00048 #ifdef INCLUDE_ALGORITHM 00049 #include "dcmtk/ofstd/ofalgo.h" 00050 #endif 00051 00052 // we don't yet support <bitset>, <complex>, <deque>, <exception>, <functional> 00053 00054 // all stream related headers are handled by "ofstream.h" 00055 #if defined(INCLUDE_IOSFWD) || defined(INCLUDE_IOSTREAM) || defined(INCLUDE_ISTREAM) || \ 00056 defined(INCLUDE_OSTREAM) || defined(INCLUDE_IOMANIP) || defined(INCLUDE_IOS) || \ 00057 defined(INCLUDE_FSTREAM) || defined(INCLUDE_SSTREAM) 00058 #include "dcmtk/ofstd/ofstream.h" 00059 #endif 00060 00061 // we don't yet support <iterator>, <limits> 00062 00063 // define INCLUDE_LIST to include "oflist.h" 00064 #ifdef INCLUDE_LIST 00065 #include "dcmtk/ofstd/oflist.h" 00066 #endif 00067 00068 // we don't yet support <locale>, <map>, <memory>, <numeric>, <queue>, <set> 00069 00070 // define INCLUDE_NEW to include <new> or <new.h> if available 00071 #ifdef INCLUDE_NEW 00072 #ifdef USE_STD_CXX_INCLUDES 00073 #include <new> 00074 #elif defined(HAVE_NEW_H) 00075 #include <new.h> 00076 #endif 00077 #endif 00078 00079 // define INCLUDE_STACK to include "ofstack.h" 00080 #ifdef INCLUDE_STACK 00081 #include "dcmtk/ofstd/ofstack.h" 00082 #endif 00083 00084 // we don't yet support <stdexcept> 00085 00086 // define INCLUDE_STREAMBUF to include <streambuf> or <streambuf.h> if available 00087 #ifdef INCLUDE_STREAMBUF 00088 #ifdef USE_STD_CXX_INCLUDES 00089 #include <streambuf> 00090 #elif defined(HAVE_STREAMBUF_H) 00091 #include <streambuf.h> 00092 #endif 00093 #endif 00094 00095 // define INCLUDE_STRING to include "ofstring.h" 00096 #ifdef INCLUDE_STRING 00097 #include "dcmtk/ofstd/ofstring.h" 00098 #endif 00099 00100 // we don't yet support <typeinfo>, <valarray>, <vector> 00101 00102 00103 /* Header files as defined in ISO/IEC 14882:1998, Section 17.4.1.2, Table 12 00104 * These are header files for the Standard C Library. 00105 */ 00106 00107 // define INCLUDE_CASSERT to include <cassert> or <assert.h> if available 00108 #ifdef INCLUDE_CASSERT 00109 #ifdef USE_STD_CXX_INCLUDES 00110 #include <cassert> 00111 #elif defined(HAVE_ASSERT_H) 00112 BEGIN_EXTERN_C 00113 #include <assert.h> 00114 END_EXTERN_C 00115 #endif 00116 #endif 00117 00118 // define INCLUDE_CCTYPE to include <cctype> or <ctype.h> if available 00119 #ifdef INCLUDE_CCTYPE 00120 #ifdef USE_STD_CXX_INCLUDES 00121 #include <cctype> 00122 #elif defined(HAVE_CTYPE_H) 00123 BEGIN_EXTERN_C 00124 #include <ctype.h> 00125 END_EXTERN_C 00126 #endif 00127 #endif 00128 00129 // define INCLUDE_CERRNO to include <cerrno> or <errno.h> if available 00130 #ifdef INCLUDE_CERRNO 00131 #ifdef USE_STD_CXX_INCLUDES 00132 #include <cerrno> 00133 #elif defined(HAVE_ERRNO_H) 00134 BEGIN_EXTERN_C 00135 #include <errno.h> 00136 END_EXTERN_C 00137 #endif 00138 #endif 00139 00140 // define INCLUDE_CFLOAT to include <cfloat> or <float.h> if available 00141 #ifdef INCLUDE_CFLOAT 00142 #ifdef USE_STD_CXX_INCLUDES 00143 #include <cfloat> 00144 #elif defined(HAVE_FLOAT_H) 00145 BEGIN_EXTERN_C 00146 #include <float.h> 00147 END_EXTERN_C 00148 #endif 00149 #endif 00150 00151 // define INCLUDE_CISO646 to include <ciso646> or <iso646.h> if available 00152 #ifdef INCLUDE_CISO646 00153 #ifdef USE_STD_CXX_INCLUDES 00154 #include <ciso646> 00155 #elif defined(HAVE_ISO646_H) 00156 BEGIN_EXTERN_C 00157 #include <iso646.h> 00158 END_EXTERN_C 00159 #endif 00160 #endif 00161 00162 // define INCLUDE_CLIMITS to include <climits> or <limits.h> if available 00163 #ifdef INCLUDE_CLIMITS 00164 #ifdef USE_STD_CXX_INCLUDES 00165 #include <climits> 00166 #elif defined(HAVE_LIMITS_H) 00167 BEGIN_EXTERN_C 00168 #include <limits.h> 00169 END_EXTERN_C 00170 #endif 00171 #endif 00172 00173 // define INCLUDE_CLOCALE to include <clocale> or <locale.h> if available 00174 #ifdef INCLUDE_CLOCALE 00175 #ifdef USE_STD_CXX_INCLUDES 00176 #include <clocale> 00177 #elif defined(HAVE_LOCALE_H) 00178 BEGIN_EXTERN_C 00179 #include <locale.h> 00180 END_EXTERN_C 00181 #endif 00182 #endif 00183 00184 // define INCLUDE_CMATH to include <cmath> or <math.h> if available 00185 #ifdef INCLUDE_CMATH 00186 #ifdef USE_STD_CXX_INCLUDES 00187 #include <cmath> 00188 #elif defined(HAVE_MATH_H) 00189 #ifndef INCLUDE_MATH_H_AS_CXX 00190 // some systems use C++ language features in <math.h> 00191 BEGIN_EXTERN_C 00192 #endif 00193 #include <math.h> 00194 #ifndef INCLUDE_MATH_H_AS_CXX 00195 END_EXTERN_C 00196 #endif 00197 #endif 00198 #endif 00199 00200 // define INCLUDE_CSETJMP to include <csetjmp> or <setjmp.h> if available 00201 #ifdef INCLUDE_CSETJMP 00202 #ifdef USE_STD_CXX_INCLUDES 00203 #include <csetjmp> 00204 #elif defined(HAVE_SETJMP_H) 00205 BEGIN_EXTERN_C 00206 #include <setjmp.h> 00207 END_EXTERN_C 00208 #endif 00209 #endif 00210 00211 // define INCLUDE_CSIGNAL to include <csignal> or <signal.h> if available 00212 #ifdef INCLUDE_CSIGNAL 00213 #ifdef USE_STD_CXX_INCLUDES 00214 #include <csignal> 00215 #elif defined(HAVE_SIGNAL_H) 00216 BEGIN_EXTERN_C 00217 #include <signal.h> 00218 END_EXTERN_C 00219 #endif 00220 #endif 00221 00222 // define INCLUDE_CSTDARG to include <cstdarg> or <stdarg.h> if available 00223 #ifdef INCLUDE_CSTDARG 00224 #ifdef USE_STD_CXX_INCLUDES 00225 #include <cstdarg> 00226 #elif defined(HAVE_STDARG_H) 00227 BEGIN_EXTERN_C 00228 #include <stdarg.h> 00229 END_EXTERN_C 00230 #endif 00231 #endif 00232 00233 // define INCLUDE_CSTDDEF to include <cstddef> or <stddef.h> if available 00234 #ifdef INCLUDE_CSTDDEF 00235 #ifdef USE_STD_CXX_INCLUDES 00236 #include <cstddef> 00237 #elif defined(HAVE_STDDEF_H) 00238 BEGIN_EXTERN_C 00239 #include <stddef.h> 00240 END_EXTERN_C 00241 #endif 00242 #endif 00243 00244 // define INCLUDE_CSTDIO to include <cstdio> or <stdio.h> if available 00245 #ifdef INCLUDE_CSTDIO 00246 #ifdef USE_STD_CXX_INCLUDES 00247 #include <cstdio> 00248 #elif defined(HAVE_STDIO_H) 00249 BEGIN_EXTERN_C 00250 #include <stdio.h> 00251 END_EXTERN_C 00252 #endif 00253 #endif 00254 00255 // define INCLUDE_CSTDLIB to include <cstdlib> or <stdlib.h> if available 00256 #ifdef INCLUDE_CSTDLIB 00257 #ifdef USE_STD_CXX_INCLUDES 00258 #include <cstdlib> 00259 #elif defined(HAVE_STDLIB_H) 00260 /* workaround for bug in Borland C++ Builder */ 00261 #ifndef __BORLANDC__ 00262 BEGIN_EXTERN_C 00263 #endif 00264 #include <stdlib.h> 00265 #ifndef __BORLANDC__ 00266 END_EXTERN_C 00267 #endif 00268 #endif 00269 #endif 00270 00271 // define INCLUDE_CSTRING to include <cstring> or <string.h> if available 00272 #ifdef INCLUDE_CSTRING 00273 #ifdef USE_STD_CXX_INCLUDES 00274 #include <cstring> 00275 #elif defined(HAVE_STRING_H) 00276 BEGIN_EXTERN_C 00277 #include <string.h> 00278 END_EXTERN_C 00279 #endif 00280 // Some platforms define additional string functions like bzero or 00281 // strcasecmp in <strings.h>, so we always include this file if available. 00282 #ifdef HAVE_STRINGS_H 00283 BEGIN_EXTERN_C 00284 #include <strings.h> 00285 END_EXTERN_C 00286 #endif 00287 #endif 00288 00289 // define INCLUDE_CTIME to include <ctime> or <time.h> if available 00290 #ifdef INCLUDE_CTIME 00291 #ifdef USE_STD_CXX_INCLUDES 00292 #include <ctime> 00293 #elif defined(HAVE_TIME_H) 00294 BEGIN_EXTERN_C 00295 #include <time.h> 00296 END_EXTERN_C 00297 #endif 00298 #endif 00299 00300 // define INCLUDE_CWCTYPE to include <cwctype> or <wctype.h> if available 00301 #ifdef INCLUDE_CWCTYPE 00302 #ifdef USE_STD_CXX_INCLUDES 00303 #include <cwctype> 00304 #elif defined(HAVE_WCTYPE_H) 00305 BEGIN_EXTERN_C 00306 #include <wctype.h> 00307 END_EXTERN_C 00308 #endif 00309 #endif 00310 00311 00312 /* Headers other than ISO C++, such as BSD and Posix.1 headers */ 00313 00314 // define INCLUDE_LIBC to include <libc.h> if available 00315 #ifdef INCLUDE_LIBC 00316 #ifdef HAVE_LIBC_H 00317 #ifndef INCLUDE_LIBC_H_AS_CXX 00318 BEGIN_EXTERN_C 00319 #endif 00320 #include <libc.h> 00321 #ifndef INCLUDE_LIBC_H_AS_CXX 00322 END_EXTERN_C 00323 #endif 00324 #endif 00325 #endif 00326 00327 // define INCLUDE_UNISTD to include <unistd.h> if available 00328 #ifdef INCLUDE_UNISTD 00329 #ifdef HAVE_UNISTD_H 00330 BEGIN_EXTERN_C 00331 #include <unistd.h> 00332 END_EXTERN_C 00333 #endif 00334 #endif 00335 00336 00337 00338 00339 /* 00340 * CVS/RCS Log: 00341 * $Log: ofstdinc.h,v $ 00342 * Revision 1.11 2005/12/08 16:06:05 meichel 00343 * Changed include path schema for all DCMTK header files 00344 * 00345 * Revision 1.10 2004/08/03 11:45:09 meichel 00346 * Added macros INCLUDE_LIBC and INCLUDE_UNISTD that correctly include libc.h 00347 * 00348 * Revision 1.9 2004/05/07 10:46:32 meichel 00349 * Removed unneeded semicolon, reported by gcc 3.4 00350 * 00351 * Revision 1.8 2003/12/11 13:40:22 meichel 00352 * Added support for including <new> or <new.h> 00353 * 00354 * Revision 1.7 2003/10/13 13:38:44 meichel 00355 * Activated Borland stdlib workaround for compiler versions other than 4. 00356 * 00357 * Revision 1.6 2002/12/16 16:20:45 meichel 00358 * Added configure test that checks if extern "C" inclusion 00359 * of <math.h> fails, e.g. on HP/UX 10 and WIN32 00360 * 00361 * Revision 1.5 2002/12/11 15:54:47 meichel 00362 * Added empty namespace std declaration, needed on MSVC. 00363 * 00364 * Revision 1.4 2002/11/28 17:16:39 meichel 00365 * Including <math.h> without extern "C" on Win32 to avoid problem with MSVC5. 00366 * 00367 * Revision 1.3 2002/11/27 17:21:18 meichel 00368 * Fixed bug in ofstack inclusion code 00369 * 00370 * Revision 1.2 2002/11/27 12:33:34 meichel 00371 * Now including <strings.h> even if <string.h> is present. 00372 * 00373 * Revision 1.1 2002/11/27 11:20:52 meichel 00374 * Added new file ofstdinc.h that encapsulates the inclusion 00375 * of old style vs. ISO C++ standard header files. 00376 * 00377 * 00378 */