Python2/Config.hxx

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // Copyright (c) 1998 - 2007, The Regents of the University of California
00004 // Produced at the Lawrence Livermore National Laboratory
00005 // All rights reserved.
00006 //
00007 // This file is part of PyCXX. For details,see http://cxx.sourceforge.net/. The
00008 // full copyright notice is contained in the file COPYRIGHT located at the root
00009 // of the PyCXX distribution.
00010 //
00011 // Redistribution  and  use  in  source  and  binary  forms,  with  or  without
00012 // modification, are permitted provided that the following conditions are met:
00013 //
00014 //  - Redistributions of  source code must  retain the above  copyright notice,
00015 //    this list of conditions and the disclaimer below.
00016 //  - Redistributions in binary form must reproduce the above copyright notice,
00017 //    this  list of  conditions  and  the  disclaimer (as noted below)  in  the
00018 //    documentation and/or materials provided with the distribution.
00019 //  - Neither the name of the UC/LLNL nor  the names of its contributors may be
00020 //    used to  endorse or  promote products derived from  this software without
00021 //    specific prior written permission.
00022 //
00023 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT  HOLDERS AND CONTRIBUTORS "AS IS"
00024 // AND ANY EXPRESS OR  IMPLIED WARRANTIES, INCLUDING,  BUT NOT  LIMITED TO, THE
00025 // IMPLIED WARRANTIES OF MERCHANTABILITY AND  FITNESS FOR A PARTICULAR  PURPOSE
00026 // ARE  DISCLAIMED.  IN  NO  EVENT  SHALL  THE  REGENTS  OF  THE  UNIVERSITY OF
00027 // CALIFORNIA, THE U.S.  DEPARTMENT  OF  ENERGY OR CONTRIBUTORS BE  LIABLE  FOR
00028 // ANY  DIRECT,  INDIRECT,  INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR CONSEQUENTIAL
00029 // DAMAGES (INCLUDING, BUT NOT  LIMITED TO, PROCUREMENT OF  SUBSTITUTE GOODS OR
00030 // SERVICES; LOSS OF  USE, DATA, OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER
00031 // CAUSED  AND  ON  ANY  THEORY  OF  LIABILITY,  WHETHER  IN  CONTRACT,  STRICT
00032 // LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING IN ANY  WAY
00033 // OUT OF THE  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00034 // DAMAGE.
00035 //
00036 //-----------------------------------------------------------------------------
00037 
00038 #ifndef __PyCXX_config_hh__
00039 #define __PyCXX_config_hh__
00040 
00041 //
00042 // Microsoft VC++ 6.0 has no traits
00043 //
00044 #if defined( _MSC_VER )
00045 
00046 #  define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1
00047 
00048 #elif defined( __GNUC__ )
00049 #  if __GNUC__ >= 3
00050 #    define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1
00051 #  else
00052 #    define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 0
00053 #endif
00054 
00055 //
00056 //      Assume all other compilers do
00057 //
00058 #else
00059 
00060 // Macros to deal with deficiencies in compilers
00061 #  define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1
00062 #endif
00063 
00064 #if STANDARD_LIBRARY_HAS_ITERATOR_TRAITS
00065 #  define random_access_iterator_parent(itemtype) std::iterator<std::random_access_iterator_tag,itemtype,int>
00066 #else
00067 #  define random_access_iterator_parent(itemtype) std::random_access_iterator<itemtype, int>
00068 #endif
00069 
00070 //
00071 //      Which C++ standard is in use?
00072 //
00073 #if defined( _MSC_VER )
00074 #  if _MSC_VER <= 1200
00075 // MSVC++ 6.0
00076 #    define PYCXX_ISO_CPP_LIB 0
00077 #    define STR_STREAM <strstream>
00078 #    define TEMPLATE_TYPENAME class
00079 #  else
00080 #    define PYCXX_ISO_CPP_LIB 1
00081 #    define STR_STREAM <sstream>
00082 #    define TEMPLATE_TYPENAME typename
00083 #  endif
00084 #elif defined( __GNUC__ )
00085 #  if __GNUC__ >= 3
00086 #    define PYCXX_ISO_CPP_LIB 1
00087 #    define STR_STREAM <sstream>
00088 #    define TEMPLATE_TYPENAME typename
00089 #  else
00090 #    define PYCXX_ISO_CPP_LIB 0
00091 #    define STR_STREAM <strstream>
00092 #    define TEMPLATE_TYPENAME class
00093 #  endif
00094 #endif
00095 
00096 #if PYCXX_ISO_CPP_LIB
00097 #    define STR_STREAM <sstream>
00098 #    define OSTRSTREAM ostringstream
00099 #    define EXPLICIT_TYPENAME typename
00100 #    define EXPLICIT_CLASS class
00101 #    define TEMPLATE_TYPENAME typename
00102 #else
00103 #    define STR_STREAM <strstream>
00104 #    define OSTRSTREAM ostrstream
00105 #    define EXPLICIT_TYPENAME
00106 #    define EXPLICIT_CLASS
00107 #    define TEMPLATE_TYPENAME class
00108 #endif
00109 
00110 // before 2.5 Py_ssize_t was missing
00111 #ifndef PY_MAJOR_VERSION
00112 #error not defined PY_MAJOR_VERSION
00113 #endif
00114 #if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5)
00115 typedef int Py_ssize_t;
00116 #endif
00117 
00118 // export macro
00119 #if defined( _MSC_VER )
00120 #  pragma warning( disable : 4251 )
00121 #endif
00122 #if defined( _MSC_VER ) || defined( __MINGW32__ )
00123 #  ifdef PYCXX_DLL
00124 #    define PYCXX_EXPORT  __declspec(dllexport)
00125 #  else
00126 #    define PYCXX_EXPORT  __declspec(dllimport)
00127 #  endif
00128 #else
00129 #    define PYCXX_EXPORT
00130 #endif
00131 
00132 #endif //  __PyCXX_config_hh__

Generated on Wed Nov 23 19:00:04 2011 for FreeCAD by  doxygen 1.6.1