| 1 | /***************************************************************************
 | 
|---|
| 2 |  * blitz/compiler.h      Compiler specific directives and kludges
 | 
|---|
| 3 |  *
 | 
|---|
| 4 |  * $Id: compiler.h,v 1.1.1.1 1999-04-09 17:58:58 ansari Exp $
 | 
|---|
| 5 |  *
 | 
|---|
| 6 |  * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
 | 
|---|
| 7 |  *
 | 
|---|
| 8 |  * This program is free software; you can redistribute it and/or
 | 
|---|
| 9 |  * modify it under the terms of the GNU General Public License
 | 
|---|
| 10 |  * as published by the Free Software Foundation; either version 2
 | 
|---|
| 11 |  * of the License, or (at your option) any later version.
 | 
|---|
| 12 |  *
 | 
|---|
| 13 |  * This program is distributed in the hope that it will be useful,
 | 
|---|
| 14 |  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
| 15 |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
| 16 |  * GNU General Public License for more details.
 | 
|---|
| 17 |  *
 | 
|---|
| 18 |  * Suggestions:          blitz-suggest@cybervision.com
 | 
|---|
| 19 |  * Bugs:                 blitz-bugs@cybervision.com
 | 
|---|
| 20 |  *
 | 
|---|
| 21 |  * For more information, please see the Blitz++ Home Page:
 | 
|---|
| 22 |  *    http://seurat.uwaterloo.ca/blitz/
 | 
|---|
| 23 |  *
 | 
|---|
| 24 |  ***************************************************************************
 | 
|---|
| 25 |  * $Log: not supported by cvs2svn $
 | 
|---|
| 26 |  * Revision 1.7  1998/03/14 00:04:47  tveldhui
 | 
|---|
| 27 |  * 0.2-alpha-05
 | 
|---|
| 28 |  *
 | 
|---|
| 29 |  * Revision 1.6  1997/07/16 14:51:20  tveldhui
 | 
|---|
| 30 |  * Update: Alpha release 0.2 (Arrays)
 | 
|---|
| 31 |  *
 | 
|---|
| 32 |  * Revision 1.5  1997/01/24 14:42:00  tveldhui
 | 
|---|
| 33 |  * Periodic RCS update
 | 
|---|
| 34 |  *
 | 
|---|
| 35 |  * Revision 1.4  1997/01/13 22:19:58  tveldhui
 | 
|---|
| 36 |  * Periodic RCS update
 | 
|---|
| 37 |  *
 | 
|---|
| 38 |  * Revision 1.3  1996/11/11 17:29:13  tveldhui
 | 
|---|
| 39 |  * Periodic RCS update
 | 
|---|
| 40 |  *
 | 
|---|
| 41 |  *
 | 
|---|
| 42 |  */
 | 
|---|
| 43 | 
 | 
|---|
| 44 | 
 | 
|---|
| 45 | #ifndef BZ_COMPILER_H
 | 
|---|
| 46 | #define BZ_COMPILER_H
 | 
|---|
| 47 | 
 | 
|---|
| 48 | // The file <blitz/config.h> is generated automatically by the
 | 
|---|
| 49 | // script 'bzconfig', located in the 'compiler' directory.
 | 
|---|
| 50 | 
 | 
|---|
| 51 | #include <blitz/config.h>
 | 
|---|
| 52 | 
 | 
|---|
| 53 | /*
 | 
|---|
| 54 |  * Define some kludges.
 | 
|---|
| 55 |  */
 | 
|---|
| 56 | 
 | 
|---|
| 57 | #ifndef BZ_TEMPLATES
 | 
|---|
| 58 |     #error  In <blitz/config.h>: A working template implementation is required by Blitz++ (you may need to rerun the compiler/bzconfig script)
 | 
|---|
| 59 | #endif
 | 
|---|
| 60 | 
 | 
|---|
| 61 | #ifndef BZ_MEMBER_TEMPLATES
 | 
|---|
| 62 |   #error  In <blitz/config.h>: Your compiler does not support member templates.  (you may need to rerun the compiler/bzconfig script)
 | 
|---|
| 63 | #endif
 | 
|---|
| 64 | 
 | 
|---|
| 65 | #ifndef BZ_FULL_SPECIALIZATION_SYNTAX
 | 
|---|
| 66 |   #error In <blitz/config.h>: Your compiler does not support template<> full specialization syntax.  You may need to rerun the compiler/bzconfig script.
 | 
|---|
| 67 | #endif
 | 
|---|
| 68 | 
 | 
|---|
| 69 | #ifndef BZ_PARTIAL_ORDERING
 | 
|---|
| 70 |   #error In <blitz/config.h>: Your compiler does not support partial ordering (you may need to rerun the compiler/bzconfig script)
 | 
|---|
| 71 | #endif
 | 
|---|
| 72 | 
 | 
|---|
| 73 | #ifndef BZ_PARTIAL_SPECIALIZATION
 | 
|---|
| 74 |   #error In <blitz/config.h>: Your compiler does not support partial specialization (you may need to rerun the compiler/bzconfig script)
 | 
|---|
| 75 | #endif
 | 
|---|
| 76 | 
 | 
|---|
| 77 | #ifdef BZ_NAMESPACES
 | 
|---|
| 78 |     #define BZ_NAMESPACE(X)        namespace X {
 | 
|---|
| 79 |     #define BZ_NAMESPACE_END       }
 | 
|---|
| 80 |     #define BZ_USING_NAMESPACE(X)  using namespace X;
 | 
|---|
| 81 | #else
 | 
|---|
| 82 |     #define BZ_NAMESPACE(X)
 | 
|---|
| 83 |     #define BZ_NAMESPACE_END
 | 
|---|
| 84 |     #define BZ_USING_NAMESPACE(X)
 | 
|---|
| 85 | #endif
 | 
|---|
| 86 | 
 | 
|---|
| 87 | #ifdef BZ_TEMPLATE_QUALIFIED_RETURN_TYPE
 | 
|---|
| 88 |   #define BZ_USE_NUMTRAIT
 | 
|---|
| 89 | #endif
 | 
|---|
| 90 | 
 | 
|---|
| 91 | #ifdef BZ_DEFAULT_TEMPLATE_PARAMETERS
 | 
|---|
| 92 |     #define BZ_TEMPLATE_DEFAULT(X)   = X
 | 
|---|
| 93 | #else
 | 
|---|
| 94 |     #define BZ_TEMPLATE_DEFAULT
 | 
|---|
| 95 | #endif
 | 
|---|
| 96 | 
 | 
|---|
| 97 | #ifdef BZ_EXPLICIT
 | 
|---|
| 98 |     #define _bz_explicit     explicit
 | 
|---|
| 99 | #else
 | 
|---|
| 100 |     #define _bz_explicit   
 | 
|---|
| 101 | #endif
 | 
|---|
| 102 | 
 | 
|---|
| 103 | #ifdef BZ_TYPENAME
 | 
|---|
| 104 |     #define _bz_typename     typename
 | 
|---|
| 105 | #else
 | 
|---|
| 106 |     #define _bz_typename
 | 
|---|
| 107 | #endif
 | 
|---|
| 108 | 
 | 
|---|
| 109 | #ifdef BZ_MUTABLE
 | 
|---|
| 110 |     #define _bz_mutable      mutable
 | 
|---|
| 111 | #else
 | 
|---|
| 112 |     #define _bz_mutable
 | 
|---|
| 113 | #endif
 | 
|---|
| 114 | 
 | 
|---|
| 115 | #ifdef BZ_DISABLE_RESTRICT
 | 
|---|
| 116 |  #undef BZ_NCEG_RESTRICT
 | 
|---|
| 117 | #endif
 | 
|---|
| 118 | 
 | 
|---|
| 119 | #ifdef BZ_NCEG_RESTRICT
 | 
|---|
| 120 |     #define _bz_restrict     restrict
 | 
|---|
| 121 | #else
 | 
|---|
| 122 |     #define _bz_restrict
 | 
|---|
| 123 | #endif
 | 
|---|
| 124 | 
 | 
|---|
| 125 | #ifdef BZ_BOOL
 | 
|---|
| 126 |     #define _bz_bool         bool
 | 
|---|
| 127 |     #define _bz_true         true
 | 
|---|
| 128 |     #define _bz_false        false
 | 
|---|
| 129 | #else
 | 
|---|
| 130 |     #define _bz_bool         int
 | 
|---|
| 131 |     #define _bz_true         1
 | 
|---|
| 132 |     #define _bz_false        0
 | 
|---|
| 133 | #endif
 | 
|---|
| 134 | 
 | 
|---|
| 135 | #ifdef BZ_ENUM_COMPUTATIONS_WITH_CAST
 | 
|---|
| 136 |     #define BZ_ENUM_CAST(X)   (int)X
 | 
|---|
| 137 | #elif defined(BZ_ENUM_COMPUTATIONS)
 | 
|---|
| 138 |     #define BZ_ENUM_CAST(X)   X
 | 
|---|
| 139 | #else
 | 
|---|
| 140 |     #error In <blitz/config.h>: Your compiler does not support enum computations.  You may have to rerun compiler/bzconfig.
 | 
|---|
| 141 | #endif
 | 
|---|
| 142 | 
 | 
|---|
| 143 | #if defined(BZ_MATH_FN_IN_NAMESPACE_STD)
 | 
|---|
| 144 |   #define BZ_MATHFN_SCOPE(x) std::x
 | 
|---|
| 145 | #elif defined(BZ_NAMESPACES)
 | 
|---|
| 146 |   #define BZ_MATHFN_SCOPE(x) ::x
 | 
|---|
| 147 | #else
 | 
|---|
| 148 |   #define BZ_MATHFN_SCOPE(x) x
 | 
|---|
| 149 | #endif
 | 
|---|
| 150 | 
 | 
|---|
| 151 | #if defined(BZ_COMPLEX_MATH_IN_NAMESPACE_STD)
 | 
|---|
| 152 |   #define BZ_CMATHFN_SCOPE(x) std::x
 | 
|---|
| 153 | #elif defined(BZ_NAMESPACES)
 | 
|---|
| 154 |   #define BZ_CMATHFN_SCOPE(x) ::x
 | 
|---|
| 155 | #else
 | 
|---|
| 156 |   #define BZ_CMATHFN_SCOPE(x) x
 | 
|---|
| 157 | #endif
 | 
|---|
| 158 | 
 | 
|---|
| 159 | #if defined(BZ_NAMESPACES)
 | 
|---|
| 160 |   #define BZ_BLITZ_SCOPE(x) blitz::x
 | 
|---|
| 161 | #else
 | 
|---|
| 162 |   #define BZ_BLITZ_SCOPE(x) ::x
 | 
|---|
| 163 | #endif
 | 
|---|
| 164 | 
 | 
|---|
| 165 | #endif // BZ_COMPILER_H
 | 
|---|
| 166 | 
 | 
|---|