/usr/include/rheolef/compiler.h is in librheolef-dev 6.5-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | #ifndef _RHEO_COMPILER_H
#define _RHEO_COMPILER_H
///
/// This file is part of Rheolef.
///
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
///
/// Rheolef is free software; you can redistribute it and/or modify
/// it under the terms of the GNU General Public License as published by
/// the Free Software Foundation; either version 2 of the License, or
/// (at your option) any later version.
///
/// Rheolef is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU General Public License for more details.
///
/// You should have received a copy of the GNU General Public License
/// along with Rheolef; if not, write to the Free Software
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
///
/// =========================================================================
//
// compiler-dependent part for rheolef implementation
//
// author: Pierre.Saramito@imag.fr
//
// date: 27 january 2000
//
#include "rheolef/config.h" /* as generated by configure */
#include <cmath>
namespace rheolef {
using std::cos;
using std::sin;
using std::tan;
using std::acos;
using std::asin;
using std::atan;
using std::cosh;
using std::sinh;
using std::tanh;
using std::exp;
using std::log;
using std::log10;
using std::sqrt;
using std::abs;
using std::fabs;
using std::floor;
using std::ceil;
using std::atan2;
using std::pow;
using std::fmod;
} // namespace rheolef
#include <complex>
namespace rheolef {
/// @brief helper for std::complex<T>: get basic T type
template<class T> struct float_traits { typedef T type; };
template<class T> struct float_traits<std::complex<T> > { typedef typename float_traits<T>::type type; };
} // namespace rheolef
// for DEC/Compacq cxx: use standard iostreams
#ifdef _RHEOLEF_HAVE_DEC_CXX
# ifndef __USE_STD_IOSTREAM
# define __USE_STD_IOSTREAM 1
# endif
#endif
// for CRAY C++ STL library: in <iterator.h>, need it
#ifdef _RHEOLEF_HAVE_CRAY_CXX
#define __STL_USE_NAMESPACES
#define __STL_CLASS_PARTIAL_SPECIALIZATION
#endif
#ifdef _RHEOLEF_HAVE_IOS
# include <ios>
#elif defined(_RHEOLEF_HAVE_IOS_H)
# include <ios.h>
#endif
// buggy g++ on SunOS defines _X !!
#ifdef _X
#undef _X
#endif
#ifdef _RHEOLEF_HAVE_ISTREAM
# include <istream>
#elif defined(_RHEOLEF_HAVE_ISTREAM_H)
# include <istream.h> /* ioskit need it without std:: for kai */
#endif
#ifdef _RHEOLEF_HAVE_OSTREAM
# include <ostream>
#elif defined(_RHEOLEF_HAVE_OSTREAM_H)
# include <ostream.h>
#endif
#ifdef _RHEOLEF_HAVE_IOSTREAM
# include <iostream>
#else
# include <iostream.h> /* ioskit need it */
#endif
#ifdef _RHEOLEF_HAVE_FSTREAM
# include <fstream>
#elif defined(_RHEOLEF_HAVE_FSTREAM_H)
# include <fstream.h>
#endif
#ifdef _RHEOLEF_HAVE_IOMANIP
# include <iomanip>
#elif defined(_RHEOLEF_HAVE_IOMANIP_H)
# include <iomanip.h>
#endif
// ==================================================================================================
// macro utilities:
// fatal_macro
// error_macro
// trace_macro
// check_macro
// assert_macro
//
# define fatal_macro(message) \
{ std::cerr << "fatal(" << __FILE__ << "," << __LINE__ << "): " << message << std::endl; exit(1); }
# define error_macro(message) \
fatal_macro(message)
# define warning_macro(message) \
{ std::cerr << "warning(" << __FILE__ << "," << __LINE__ << "): " << message << std::endl; }
# define check_macro(ok_condition, message) \
{ if (!(ok_condition)) fatal_macro(message); }
# ifdef _RHEOLEF_PARANO
# ifdef NDEBUG
# undef NDEBUG
# endif
# define trace_macro(message) \
{ std::cerr << "trace(" << __FILE__ << "," << __LINE__ << "): " << message << std::endl; }
# define assert_macro(ok_condition, message) \
check_macro(ok_condition,message)
# else // not _RHEOLEF_PARANO
# ifndef NDEBUG
# define NDEBUG
# endif
# define trace_macro(message)
# define assert_macro(ok_condition, message)
# endif // _RHEOLEF_PARANO
// ==================================================================================================
#ifdef _RHEOLEF_HAVE_LIMITS
#include <limits>
#else
#error numeric_limits<T> C++ class not available in standard library: please, update your compiler !
// substitution for numeric_limits<T> class
// #include "rheolef/numeric_limits.h"
#endif // _RHEOLEF_HAVE_LIMITS
#include "rheolef/numeric_flags.h"
// Float type used for the library pre-instanciation
#if defined(_RHEOLEF_HAVE_CLN)
# include "rheolef/bigfloat.h"
namespace rheolef {
typedef bigfloat<_RHEOLEF_DIGITS10> Float;
} // namespace rheolef
#elif defined(_RHEOLEF_HAVE_DOUBLEDOUBLE)
# define DD_INLINE
# include "rheolef/doubledouble.h"
namespace rheolef {
typedef doubledouble Float;
} // namespace rheolef
#elif defined(_RHEOLEF_HAVE_LONG_DOUBLE)
namespace rheolef {
typedef long double Float;
} // namespace rheolef
#else
namespace rheolef {
typedef double Float;
} // namespace rheolef
#endif // FLOAT: CLN, DOUBLEDOUBLE, LONG_DOUBLE, ...
/* max size for char* filename; TODO: may disapear from code... */
#define STRLENMAX 1024
#ifdef _RHEOLEF_HAVE_MEMORY_H
#include <memory.h> // KAI C++
#endif
#if !defined(_RHEOLEF_HAVE_SQR_DOUBLE) && !defined(_RHEOLEF_HAVE_DOUBLEDOUBLE)
namespace rheolef {
static inline double sqr (const double& x) { return (x*x); }
} // namespace rheolef
#endif
#if defined(_RHEOLEF_HAVE_ITERATOR)
#include <iterator> // DEC C++
#elif defined(_RHEOLEF_HAVE_ITERATOR_H)
#include <iterator.h>
#endif
// there is no std on string...
#if defined(_RHEOLEF_HAVE_STRING)
#include <string>
#elif defined(_RHEOLEF_HAVE_BSTRING_H)
#include <bstring.h>
#elif defined(_RHEOLEF_HAVE_MSTRING_H)
#include <mstring.h>
#endif
// greater/less, ect...
#if defined(_RHEOLEF_HAVE_FUNCTIONAL)
#include <functional> // DEC C++
#elif defined(_RHEOLEF_HAVE_FUNCTIONAL_H)
#include <functional.h> // KAI C++
#elif defined(_RHEOLEF_HAVE_FUNCTION_H)
#include <function.h> // GNU C++
#endif
// inner_product, ect...
#if defined(_RHEOLEF_HAVE_NUMERIC)
#include <numeric> // standard c++
#elif defined(_RHEOLEF_HAVE_NUMERIC_H)
#include <numeric.h> // KAI C++
#endif
#if defined(_RHEOLEF_HAVE_ALGORITHM)
#include <algorithm> // standard
#elif defined(_RHEOLEF_HAVE_ALGO_H)
#include <algo.h> // old GNU C++
#endif
namespace rheolef {
using std::min;
using std::max;
#ifdef TO_CLEAN
// TODO: promote<T1,T2>::type max(T1,T2) {...}
// conflict with max(field_nonlinear_expr<E>,int)
template <class T> T max (T x, int y) { return x > y ? x : T(y); }
template <class T> T max (int x, T y) { return x > y ? T(x) : y; }
template <class T> T min (T x, int y) { return x < y ? x : T(y); }
template <class T> T min (int x, T y) { return x < y ? T(x) : y; }
// conflict with ginac::abs
template <class T> T abs (T x) { return (x > T(0) ? x : -x); }
#endif // TO_CLEAN
} // namespace rheolef
#if defined(_RHEOLEF_HAVE_CSTLIB)
# include <cstdlib>
#else
# include <stdlib.h>
#endif
#if defined(_RHEOLEF_HAVE_CSTLIB)
# include <cstdio>
#else
# include <stdio.h>
#endif
#if defined(_RHEOLEF_HAVE_CLIMITS)
# include <climits> /* MAXINT, HUGE */
#else
# include <limits.h> /* MAXINT, HUGE */
#endif
#ifdef _RHEOLEF_HAVE_UTILITY
#include <utility>
#elif defined(_RHEOLEF_HAVE_UTILITY_H)
#include <utility.h> // pair with KAI C++
#endif
#if defined(_RHEOLEF_HAVE_VECTOR)
#include <vector>
#else
#include <vector.h>
#endif
#if defined(_RHEOLEF_HAVE_LIST)
#include <list>
#else
#include <list.h>
#endif
#if defined(_RHEOLEF_HAVE_SET)
#include <set>
#else
#include <set.h>
#endif
#if defined(_RHEOLEF_HAVE_MAP)
#include <map>
#else
#include <map.h>
#endif
// by default ublas::vector<T>::iterator has no [i] accessors
#if defined(_RHEOLEF_HAVE_BOOST)
#define BOOST_UBLAS_USE_INDEXED_ITERATOR
#endif
// macros wrapper for new and delette
// macros wrapper for new and delette
// when debuging with malloc_dbg
//
# ifdef _RHEOLEF_HAVE_DMALLOC /* C++ malloc debug */
#include <dmalloc.h> // link also with -ldmalloc
#include "rheolef/dmalloc_return.h" // from dmalloc lib
// defined in "util/dmallocxx/dmallocc.cc"
// put it in global namespace:
#define USE_NEW_INLINE
#ifdef USE_NEW_INLINE
inline
void *operator new(size_t size, const char *const file, int line)
{
if (size == 0) return (void*)0;
return dmalloc_malloc(file, line, size, DMALLOC_FUNC_NEW,
0 /* no alignment */, 0 /* no xalloc messages */);
}
inline
void *operator new[](size_t size, const char *const file, int line)
{
if (size == 0) return (void*)0;
return dmalloc_malloc(file, line, size, DMALLOC_FUNC_NEW_ARRAY,
0 /* no alignment */, 0 /* no xalloc messages */);
}
inline
void
operator delete(void *pnt)
{
char *file;
GET_RET_ADDR(file);
dmalloc_free(file, 0, pnt, DMALLOC_FUNC_DELETE);
}
inline
void
operator delete[](void *pnt)
{
char *file;
GET_RET_ADDR(file);
dmalloc_free(file, 0, pnt, DMALLOC_FUNC_DELETE_ARRAY);
}
#else // USE_NEW_INLINE
void *operator new(size_t, const char *const, int);
void *operator new[](size_t, const char *const, int);
void operator delete(void *);
void operator delete[](void *);
#endif // USE_NEW_INLINE
# define new_macro(obj) new (__FILE__ , __LINE__) obj
# define new_tab_macro(typ, n) (new (__FILE__ , __LINE__) typ [(n)])
# define delete_macro(ptr) { if (ptr) delete (ptr); }
# define delete_tab_macro(ptr) { if (ptr) delete [] (ptr); }
# else // ! _RHEOLEF_HAVE_DMALLOC : standard c++ new, delete
# define new_macro(obj) (new obj)
# define new_tab_macro(typ, n) (new typ [(n)])
# define delete_macro(ptr) { if (ptr) delete (ptr); }
# define delete_tab_macro(ptr) { if (ptr) delete [] (ptr); }
# endif // _RHEOLEF_HAVE_DMALLOC
#endif // _RHEO_COMPILER_H
|