1
//-----------------------------------------------------------------------------
3
// Copyright (c) 1998 - 2007, The Regents of the University of California
4
// Produced at the Lawrence Livermore National Laboratory
5
// All rights reserved.
7
// This file is part of PyCXX. For details,see http://cxx.sourceforge.net/. The
8
// full copyright notice is contained in the file COPYRIGHT located at the root
9
// of the PyCXX distribution.
11
// Redistribution and use in source and binary forms, with or without
12
// modification, are permitted provided that the following conditions are met:
14
// - Redistributions of source code must retain the above copyright notice,
15
// this list of conditions and the disclaimer below.
16
// - Redistributions in binary form must reproduce the above copyright notice,
17
// this list of conditions and the disclaimer (as noted below) in the
18
// documentation and/or materials provided with the distribution.
19
// - Neither the name of the UC/LLNL nor the names of its contributors may be
20
// used to endorse or promote products derived from this software without
21
// specific prior written permission.
23
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
27
// CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
28
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
36
//-----------------------------------------------------------------------------
38
#ifndef __PyCXX_config_hh__
39
#define __PyCXX_config_hh__
42
// Microsoft VC++ 6.0 has no traits
44
#if defined( _MSC_VER )
46
# define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1
48
#elif defined( __GNUC__ )
50
# define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1
52
# define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 0
56
// Assume all other compilers do
60
// Macros to deal with deficiencies in compilers
61
# define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1
64
#if STANDARD_LIBRARY_HAS_ITERATOR_TRAITS
65
# define random_access_iterator_parent(itemtype) std::iterator<std::random_access_iterator_tag,itemtype,int>
67
# define random_access_iterator_parent(itemtype) std::random_access_iterator<itemtype, int>
71
// Which C++ standard is in use?
73
#if defined( _MSC_VER )
76
# define PYCXX_ISO_CPP_LIB 0
77
# define STR_STREAM <strstream>
78
# define TEMPLATE_TYPENAME class
80
# define PYCXX_ISO_CPP_LIB 1
81
# define STR_STREAM <sstream>
82
# define TEMPLATE_TYPENAME typename
84
#elif defined( __GNUC__ )
86
# define PYCXX_ISO_CPP_LIB 1
87
# define STR_STREAM <sstream>
88
# define TEMPLATE_TYPENAME typename
90
# define PYCXX_ISO_CPP_LIB 0
91
# define STR_STREAM <strstream>
92
# define TEMPLATE_TYPENAME class
97
# define STR_STREAM <sstream>
98
# define OSTRSTREAM ostringstream
99
# define EXPLICIT_TYPENAME typename
100
# define EXPLICIT_CLASS class
101
# define TEMPLATE_TYPENAME typename
103
# define STR_STREAM <strstream>
104
# define OSTRSTREAM ostrstream
105
# define EXPLICIT_TYPENAME
106
# define EXPLICIT_CLASS
107
# define TEMPLATE_TYPENAME class
110
// before 2.5 Py_ssize_t was missing
111
#ifndef PY_MAJOR_VERSION
112
#error not defined PY_MAJOR_VERSION
114
#if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5)
115
typedef int Py_ssize_t;
118
#endif // __PyCXX_config_hh__