fei_macros.hpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2007 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _fei_macros_hpp_
00010 #define _fei_macros_hpp_
00011 
00012 
00013 /*
00014  * ALL FEI source files must include this header, either directly or indirectly,
00015  * before any declaration or executable statement.
00016  *
00017  * Once this header has been included, all macros that matter to FEI code are
00018  * defined, except for "derivative" macros like FEI_OSTREAM which are defined
00019  * in response to other macros (see fei_iostream.hpp,fei_iosfwd.hpp).
00020  */
00021 
00022 
00023 //Simulate bool support if the compiler being used doesn't have built-in bool
00024 //(Is there still such a compiler as of 2007?)
00025 //This should almost never be needed.
00026 #ifdef FEI_SIMULATE_BOOL
00027 #include "fei_bool.h"
00028 #endif
00029 
00030 
00031 //FEI_config.h contains macros defined by autoconf-configure. If you
00032 //choose not to run configure, you can define the macro
00033 // FEI_BYPASS_CONFIG_H when building fei, and when including fei headers
00034 //from your client code. This way FEI_config.h (generated by configure)
00035 //will not be included.
00036 //Note that if you define FEI_BYPASS_CONFIG_H then you should also define
00037 //appropriate macros that configure would have defined. The necessary ones
00038 //appear below, where they are used to turn on corresponding FEI_ macros.
00039 
00040 #ifndef FEI_BYPASS_CONFIG_H
00041 #include "FEI_config.h"
00042 #else
00043 
00044 #ifndef HAVE_NO_MPI
00045 #define HAVE_MPI
00046 #endif
00047 
00048 #endif
00049 
00050 //
00051 // React to various configure-defined macros by setting
00052 // corresponding fei-specific macros.
00053 // Note that we only define fei-specific macros for stuff that we fear may
00054 // not always be present. Things that are assumed to always be present (such
00055 // as <vector>, <string> etc) are included from various fei files without
00056 // macro protection.
00057 //
00058 
00059 //If <time.h> is not available, define HAVE_NO_TIME_H and fei files will
00060 //not attempt to include it.
00061 
00062 #ifndef HAVE_NO_TIME_H
00063 #define FEI_HAVE_TIME_H
00064 //allows #include <time.h>
00065 #endif
00066 
00067 #ifndef HAVE_NO_IOSFWD
00068 #define FEI_HAVE_IOSFWD
00069 //allows #include <iosfwd>
00070 #endif
00071 
00072 //
00073 //In most cases the C++ implementation should supply these headers:
00074 // <iosfwd>, <iomanip>, <iostream>, <fstream>, <sstream>
00075 //but some very old C++ implementations used to only supply these:
00076 // <iomanip.h>, <iostream.h>, <fstream.h>, <sstream.h>
00077 //Hopefully these days the 'dotless' headers are always available...
00078 //
00079 //Below, the 'dotless' headers are assumed to be available by default.
00080 //To indicate that one or more of the 'dotless' headers are NOT available,
00081 //define the macro HAVE_NO_'HEADER' where 'HEADER' is the header that isn't
00082 //available. Then, we'll attempt to use the .h version of the header.
00083 //
00084 
00085 #include <stdexcept>
00086 
00087 #ifdef HAVE_NO_IOMANIP
00088 #define FEI_HAVE_IOMANIP_H
00089 //allows #include <iomanip.h>
00090 #else
00091 #define FEI_HAVE_IOMANIP
00092 //allows #include <iomanip>
00093 #endif
00094 
00095 #ifdef HAVE_NO_IOSTREAM
00096 #define FEI_HAVE_IOSTREAM_H
00097 //allows #include <iostream.h>
00098 #else
00099 #define FEI_HAVE_IOSTREAM
00100 //allows #include <iostream>
00101 #endif
00102 
00103 #ifdef HAVE_NO_FSTREAM
00104 #define FEI_HAVE_FSTREAM_H
00105 //allows #include <fstream.h>
00106 #else
00107 #define FEI_HAVE_FSTREAM
00108 //allows #include <fstream>
00109 #endif
00110 
00111 #ifdef HAVE_NO_SSTREAM
00112 #define FEI_HAVE_SSTREAM_H
00113 //allows #include <sstream.h>
00114 #else
00115 #define FEI_HAVE_SSTREAM
00116 //allows #include <sstream>
00117 #endif
00118 
00119 #ifndef FEI_NO_STD_IOS_FMTFLAGS
00120 #define FEI_HAVE_STD_IOS_FMTFLAGS
00121 //see fei_iostream.hpp
00122 #endif
00123 
00124 #ifndef HAVE_MPI
00125 #define FEI_SER
00126 //if FEI_SER is defined, don't try to include <mpi.h>
00127 #endif
00128 
00129 #include "fei_version.h"
00130 
00131 #endif // _fei_macros_hpp_
00132 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
Generated on Wed Apr 13 10:08:24 2011 for FEI by  doxygen 1.6.3