FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_macros.hpp
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2007 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _fei_macros_hpp_
10 #define _fei_macros_hpp_
11 
12 
13 /*
14  * ALL FEI source files must include this header, either directly or indirectly,
15  * before any declaration or executable statement.
16  *
17  * Once this header has been included, all macros that matter to FEI code are
18  * defined, except for "derivative" macros like FEI_OSTREAM which are defined
19  * in response to other macros (see fei_iostream.hpp,fei_iosfwd.hpp).
20  */
21 
22 
23 //Simulate bool support if the compiler being used doesn't have built-in bool
24 //(Is there still such a compiler as of 2007?)
25 //This should almost never be needed.
26 #ifdef FEI_SIMULATE_BOOL
27 #include "fei_bool.h"
28 #endif
29 
30 
31 //FEI_config.h contains macros defined by autoconf-configure. If you
32 //choose not to run configure, you can define the macro
33 // FEI_BYPASS_CONFIG_H when building fei, and when including fei headers
34 //from your client code. This way FEI_config.h (generated by configure)
35 //will not be included.
36 //Note that if you define FEI_BYPASS_CONFIG_H then you should also define
37 //appropriate macros that configure would have defined. The necessary ones
38 //appear below, where they are used to turn on corresponding FEI_ macros.
39 
40 #ifndef FEI_BYPASS_CONFIG_H
41 #include "FEI_config.h"
42 #else
43 
44 #ifndef HAVE_NO_MPI
45 #define HAVE_MPI
46 #endif
47 
48 #endif
49 
50 //
51 // React to various configure-defined macros by setting
52 // corresponding fei-specific macros.
53 // Note that we only define fei-specific macros for stuff that we fear may
54 // not always be present. Things that are assumed to always be present (such
55 // as <vector>, <string> etc) are included from various fei files without
56 // macro protection.
57 //
58 
59 //If <time.h> is not available, define HAVE_NO_TIME_H and fei files will
60 //not attempt to include it.
61 
62 #ifndef HAVE_NO_TIME_H
63 #define FEI_HAVE_TIME_H
64 //allows #include <time.h>
65 #endif
66 
67 #ifndef HAVE_NO_IOSFWD
68 #define FEI_HAVE_IOSFWD
69 //allows #include <iosfwd>
70 #endif
71 
72 //
73 //In most cases the C++ implementation should supply these headers:
74 // <iosfwd>, <iomanip>, <iostream>, <fstream>, <sstream>
75 //but some very old C++ implementations used to only supply these:
76 // <iomanip.h>, <iostream.h>, <fstream.h>, <sstream.h>
77 //Hopefully these days the 'dotless' headers are always available...
78 //
79 //Below, the 'dotless' headers are assumed to be available by default.
80 //To indicate that one or more of the 'dotless' headers are NOT available,
81 //define the macro HAVE_NO_'HEADER' where 'HEADER' is the header that isn't
82 //available. Then, we'll attempt to use the .h version of the header.
83 //
84 
85 #include <stdexcept>
86 
87 #ifdef HAVE_NO_IOMANIP
88 #define FEI_HAVE_IOMANIP_H
89 //allows #include <iomanip.h>
90 #else
91 #define FEI_HAVE_IOMANIP
92 //allows #include <iomanip>
93 #endif
94 
95 #ifdef HAVE_NO_IOSTREAM
96 #define FEI_HAVE_IOSTREAM_H
97 //allows #include <iostream.h>
98 #else
99 #define FEI_HAVE_IOSTREAM
100 //allows #include <iostream>
101 #endif
102 
103 #ifdef HAVE_NO_FSTREAM
104 #define FEI_HAVE_FSTREAM_H
105 //allows #include <fstream.h>
106 #else
107 #define FEI_HAVE_FSTREAM
108 //allows #include <fstream>
109 #endif
110 
111 #ifdef HAVE_NO_SSTREAM
112 #define FEI_HAVE_SSTREAM_H
113 //allows #include <sstream.h>
114 #else
115 #define FEI_HAVE_SSTREAM
116 //allows #include <sstream>
117 #endif
118 
119 #ifndef FEI_NO_STD_IOS_FMTFLAGS
120 #define FEI_HAVE_STD_IOS_FMTFLAGS
121 //see fei_iostream.hpp
122 #endif
123 
124 #ifndef HAVE_MPI
125 #define FEI_SER
126 //if FEI_SER is defined, don't try to include <mpi.h>
127 #endif
128 
129 #include "fei_version.h"
130 
131 #endif // _fei_macros_hpp_
132