casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
aipsdef.h
Go to the documentation of this file.
00001 //# aipsdef.h: Global initialization for special aips++ macros
00002 //# Copyright (C) 2000,2001,2002
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: aipsdef.h 20551 2009-03-25 00:11:33Z Malte.Marquarding $
00027 
00028 #ifndef CASA_AIPSDEF_H
00029 #define CASA_AIPSDEF_H
00030 
00031 //# Define the aips++ global macros
00032 
00033 //# Defined the "aips_name2" macro which is used to join two tokens.
00034 
00035 #if defined(__STDC__) || defined(__ANSI_CPP__) || defined(__hpux)
00036 #define aips_name2(a,b) a##b
00037 #else
00038 #define aips_name2(a,b) ab
00039 #endif
00040 
00041 namespace casa { //# NAMESPACE CASA - BEGIN
00042 
00043 // If AIPS_DEBUG is not defined, then the symbol expands to (0) which in an
00044 // if should be removed by the dead code eliminator of any optimizer; thus
00045 // using this in your code should have no performance penalty in the normal
00046 // case. If compiled with AIPS_DEBUG, then aips_debug is (defined to )
00047 // a global boolean variable (so it can be turned on and off in a debugger) 
00048 // which is initialized to True.
00049 
00050 extern Bool aips_debug_on;
00051 
00052 } //# NAMESPACE CASA - END
00053 
00054 #if !defined(AIPS_DEBUG)
00055 #define aips_debug (0)
00056 #else
00057 // The reason that we just don't make this a variable here is so that
00058 // we can link against libraries compiled with or without AIPS_DEBUG
00059 // without having any missing symbols.
00060 #define aips_debug aips_debug_on
00061 #endif
00062 
00063 // With sgi the AIPS_USE_NEW_SGI switch is always set to cater for
00064 // still existing problems in FFTPack and SquareMatrix. It should be removed
00065 // at some stage.
00066 // Note that for the gcc compiler 'std::' is recognised as '::' for now.
00067 #if defined(__sgi)
00068 #define AIPS_USE_NEW_SGI
00069 #define AIPS_SGI
00070 namespace std {};
00071 #endif
00072 
00073 // HP/UX
00074 #if defined(__hpux__)
00075 #define AIPS_HPUX
00076 #endif
00077 
00078 // The restrict keyword is supported by some compilers only.
00079 #if !defined(AIPS_KAICC) && !defined(AIPS_INTELCC)
00080 #if !defined(restrict)
00081 #define restrict
00082 #endif
00083 #endif
00084 
00085 // SUN Native compiler has trouble with typedef inside class.
00086 // PGI compiler (QK_USER) on Cray XT3 needs throw specification in .cc file.
00087 #if defined(AIPS_SUN_NATIVE)
00088 #define WHATEVER_SUN_TYPEDEF(X) X::
00089 #define WHATEVER_TYPENAME
00090 #define WHATEVER_SUN_EXCEPTSPEC(X) throw(X)
00091 #else
00092 #define WHATEVER_SUN_TYPEDEF(X)
00093 #define WHATEVER_TYPENAME typename
00094 #if defined(AIPS_CRAY_PGI)
00095 #define WHATEVER_SUN_EXCEPTSPEC(X) throw(X)
00096 #else
00097 #define WHATEVER_SUN_EXCEPTSPEC(X)
00098 #endif
00099 #endif
00100 
00101 #if defined(AIPS_USE_NEW_SGI) || defined(AIPS_GCC3) || defined(AIPS_GCC4) || defined(AIPS_CRAY_PGI)
00102 #if defined(WHATEVER_VECTOR_FORWARD_DEC)
00103 #undef WHATEVER_VECTOR_FORWARD_DEC
00104 #endif
00105 #else
00106 #define WHATEVER_VECTOR_FORWARD_DEC template <class T, class U> class vector
00107 #endif
00108 
00109 #endif