casacore
aipsdef.h
Go to the documentation of this file.
1 //# aipsdef.h: Global initialization for special Casacore macros
2 //# Copyright (C) 2000,2001,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef CASA_AIPSDEF_H
29 #define CASA_AIPSDEF_H
30 
31 #include <casacore/casa/aipstype.h> //# needed for Bool
32 
33 //# Define the Casacore global macros
34 
35 //# Defined the "aips_name2" macro which is used to join two tokens.
36 
37 #if defined(__STDC__) || defined(__ANSI_CPP__) || defined(__hpux)
38 #define aips_name2(a,b) a##b
39 #else
40 #define aips_name2(a,b) ab
41 #endif
42 
43 namespace casacore { //# NAMESPACE CASACORE - BEGIN
44 
45 // If AIPS_DEBUG is not defined, then the symbol expands to (0) which in an
46 // if should be removed by the dead code eliminator of any optimizer; thus
47 // using this in your code should have no performance penalty in the normal
48 // case. If compiled with AIPS_DEBUG, then aips_debug is (defined to )
49 // a global boolean variable (so it can be turned on and off in a debugger)
50 // which is initialized to True.
51 
52 extern Bool aips_debug_on;
53 
54 } //# NAMESPACE CASACORE - END
55 
56 #if !defined(AIPS_DEBUG)
57 #define aips_debug (0)
58 #else
59 // The reason that we just don't make this a variable here is so that
60 // we can link against libraries compiled with or without AIPS_DEBUG
61 // without having any missing symbols.
62 #define aips_debug aips_debug_on
63 #endif
64 
65 // With sgi the AIPS_USE_NEW_SGI switch is always set to cater for
66 // still existing problems in FFTPack and SquareMatrix. It should be removed
67 // at some stage.
68 // Note that for the gcc compiler 'std::' is recognised as '::' for now.
69 #if defined(__sgi)
70 #define AIPS_USE_NEW_SGI
71 #define AIPS_SGI
72 namespace std {};
73 #endif
74 
75 // HP/UX
76 #if defined(__hpux__)
77 #define AIPS_HPUX
78 #endif
79 
80 // The restrict keyword is supported by some compilers only.
81 #if !defined(AIPS_KAICC) && !defined(AIPS_INTELCC)
82 #if !defined(restrict)
83 #define restrict
84 #endif
85 #endif
86 
87 // SUN Native compiler has trouble with typedef inside class.
88 // PGI compiler (QK_USER) on Cray XT3 needs throw specification in .cc file.
89 #if defined(AIPS_SUN_NATIVE)
90 #define WHATEVER_SUN_TYPEDEF(X) X::
91 #define WHATEVER_TYPENAME
92 #define WHATEVER_SUN_EXCEPTSPEC(X) throw(X)
93 #else
94 #define WHATEVER_SUN_TYPEDEF(X)
95 #define WHATEVER_TYPENAME typename
96 #if defined(AIPS_CRAY_PGI) || defined(AIPS_GCC)
97 #define WHATEVER_SUN_EXCEPTSPEC(X) throw(X)
98 #else
99 #define WHATEVER_SUN_EXCEPTSPEC(X)
100 #endif
101 #endif
102 
103 #if defined(AIPS_USE_NEW_SGI) || defined(AIPS_GCC) || defined(AIPS_CRAY_PGI)
104 #if defined(WHATEVER_VECTOR_FORWARD_DEC)
105 #undef WHATEVER_VECTOR_FORWARD_DEC
106 #endif
107 #else
108 #define WHATEVER_VECTOR_FORWARD_DEC template <class T, class U> class vector
109 #endif
110 
111 #endif
Define real & complex conjugation for non-complex types and put comparisons into std namespace...
Definition: Complex.h:344
Bool aips_debug_on
If AIPS_DEBUG is not defined, then the symbol expands to (0) which in an if should be removed by the ...
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:39
this file contains all the compiler specific defines
Definition: mainpage.dox:28