FEI Version of the Day
fei_macros.hpp
00001 /*
00002 // @HEADER
00003 // ************************************************************************
00004 //             FEI: Finite Element Interface to Linear Solvers
00005 //                  Copyright (2005) Sandia Corporation.
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the
00008 // U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Alan Williams (william@sandia.gov) 
00038 //
00039 // ************************************************************************
00040 // @HEADER
00041 */
00042 
00043 
00044 #ifndef _fei_macros_hpp_
00045 #define _fei_macros_hpp_
00046 
00047 
00048 /*
00049  * ALL FEI source files must include this header, either directly or indirectly,
00050  * before any declaration or executable statement.
00051  *
00052  * Once this header has been included, all macros that matter to FEI code are
00053  * defined, except for "derivative" macros like FEI_OSTREAM which are defined
00054  * in response to other macros (see fei_iostream.hpp,fei_iosfwd.hpp).
00055  */
00056 
00057 
00058 //Simulate bool support if the compiler being used doesn't have built-in bool
00059 //(Is there still such a compiler as of 2007?)
00060 //This should almost never be needed.
00061 #ifdef FEI_SIMULATE_BOOL
00062 #include "fei_bool.h"
00063 #endif
00064 
00065 
00066 //FEI_config.h contains macros defined by autoconf-configure. If you
00067 //choose not to run configure, you can define the macro
00068 // FEI_BYPASS_CONFIG_H when building fei, and when including fei headers
00069 //from your client code. This way FEI_config.h (generated by configure)
00070 //will not be included.
00071 //Note that if you define FEI_BYPASS_CONFIG_H then you should also define
00072 //appropriate macros that configure would have defined. The necessary ones
00073 //appear below, where they are used to turn on corresponding FEI_ macros.
00074 
00075 #ifndef FEI_BYPASS_CONFIG_H
00076 #include "FEI_config.h"
00077 #else
00078 
00079 #ifndef HAVE_NO_MPI
00080 #define HAVE_MPI
00081 #endif
00082 
00083 #endif
00084 
00085 //
00086 // React to various configure-defined macros by setting
00087 // corresponding fei-specific macros.
00088 // Note that we only define fei-specific macros for stuff that we fear may
00089 // not always be present. Things that are assumed to always be present (such
00090 // as <vector>, <string> etc) are included from various fei files without
00091 // macro protection.
00092 //
00093 
00094 //If <time.h> is not available, define HAVE_NO_TIME_H and fei files will
00095 //not attempt to include it.
00096 
00097 #ifndef HAVE_NO_TIME_H
00098 #define FEI_HAVE_TIME_H
00099 //allows #include <time.h>
00100 #endif
00101 
00102 #ifndef HAVE_NO_IOSFWD
00103 #define FEI_HAVE_IOSFWD
00104 //allows #include <iosfwd>
00105 #endif
00106 
00107 //
00108 //In most cases the C++ implementation should supply these headers:
00109 // <iosfwd>, <iomanip>, <iostream>, <fstream>, <sstream>
00110 //but some very old C++ implementations used to only supply these:
00111 // <iomanip.h>, <iostream.h>, <fstream.h>, <sstream.h>
00112 //Hopefully these days the 'dotless' headers are always available...
00113 //
00114 //Below, the 'dotless' headers are assumed to be available by default.
00115 //To indicate that one or more of the 'dotless' headers are NOT available,
00116 //define the macro HAVE_NO_'HEADER' where 'HEADER' is the header that isn't
00117 //available. Then, we'll attempt to use the .h version of the header.
00118 //
00119 
00120 #include <stdexcept>
00121 
00122 #ifdef HAVE_NO_IOMANIP
00123 #define FEI_HAVE_IOMANIP_H
00124 //allows #include <iomanip.h>
00125 #else
00126 #define FEI_HAVE_IOMANIP
00127 //allows #include <iomanip>
00128 #endif
00129 
00130 #ifdef HAVE_NO_IOSTREAM
00131 #define FEI_HAVE_IOSTREAM_H
00132 //allows #include <iostream.h>
00133 #else
00134 #define FEI_HAVE_IOSTREAM
00135 //allows #include <iostream>
00136 #endif
00137 
00138 #ifdef HAVE_NO_FSTREAM
00139 #define FEI_HAVE_FSTREAM_H
00140 //allows #include <fstream.h>
00141 #else
00142 #define FEI_HAVE_FSTREAM
00143 //allows #include <fstream>
00144 #endif
00145 
00146 #ifdef HAVE_NO_SSTREAM
00147 #define FEI_HAVE_SSTREAM_H
00148 //allows #include <sstream.h>
00149 #else
00150 #define FEI_HAVE_SSTREAM
00151 //allows #include <sstream>
00152 #endif
00153 
00154 #ifndef FEI_NO_STD_IOS_FMTFLAGS
00155 #define FEI_HAVE_STD_IOS_FMTFLAGS
00156 //see fei_iostream.hpp
00157 #endif
00158 
00159 #ifndef HAVE_MPI
00160 #define FEI_SER
00161 //if FEI_SER is defined, don't try to include <mpi.h>
00162 #endif
00163 
00164 #include "fei_version.h"
00165 
00166 #endif // _fei_macros_hpp_
00167 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends