diff --git a/Packages/Configuration/changes.txt b/Packages/Configuration/changes.txt index 738457962a9..9dff81b3ac5 100644 --- a/Packages/Configuration/changes.txt +++ b/Packages/Configuration/changes.txt @@ -1,3 +1,7 @@ +2.56 (mh) +- removed obsolete workaround files +- set NOMINMAX in config.h if _MSC_VER is defined + 2.55 (rursu) - removed couple lines from config.h used for cl1200 diff --git a/Packages/Configuration/config/testfiles/CGAL_CFG_NOMINMAX_BUG.C b/Packages/Configuration/config/testfiles/CGAL_CFG_NOMINMAX_BUG.C deleted file mode 100644 index 7a71913ef1e..00000000000 --- a/Packages/Configuration/config/testfiles/CGAL_CFG_NOMINMAX_BUG.C +++ /dev/null @@ -1,45 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 2002 The CGAL Consortium -// -// This software and related documentation is part of an INTERNAL release -// of the Computational Geometry Algorithms Library (CGAL). It is not -// intended for general use. -// -// ---------------------------------------------------------------------- -// -// release : -// release_date : -// -// file : config/testfiles/CGAL_CFG_NOMINMAX_BUG.C -// package : Configuration (2.3) -// author(s) : Radu Ursu -// -// coordinator : Radu Ursu -- rursu@sophia.inria.fr -// -// ====================================================================== - -// CGAL_CFG_NOMINMAX_BUG.C -// --------------------------------------------------------------------- -// A short test program to evaluate a C++ compiler. -// This program is used by cgal_configure. -// The following documentation will be pasted in the generated configfile. -// --------------------------------------------------------------------- - -//|This is a test-case for a bug in VC++ 7.0 -// that redefines min(a, b) and max(a, b) -//| Files concerned: windows.h, windef.h -//| When the bug is present, CGAL_CFG_NOMINMAX_BUG is set -//| The file basic.h should check if this bug is present and if so, -// define NOMINMAX flag - -#if defined _MSC_VER -#error "NOMINMAX flag should be set" -#endif - -int main(){ - return 0; -} - - - diff --git a/Packages/Configuration/config/testfiles/CGAL_CFG_NO_ITERATOR_TRAITS.C b/Packages/Configuration/config/testfiles/CGAL_CFG_NO_ITERATOR_TRAITS.C deleted file mode 100644 index 7d3368f6047..00000000000 --- a/Packages/Configuration/config/testfiles/CGAL_CFG_NO_ITERATOR_TRAITS.C +++ /dev/null @@ -1,131 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 1997 The CGAL Consortium -// -// ---------------------------------------------------------------------- -// -// release : -// release_date : -// -// file : config/testfiles/CGAL_CFG_NO_ITERATOR_TRAITS.C -// source : -// revision : 1.11 -// revision_date : 29 Mar 1998 -// author(s) : various -// -// coordinator : Utrecht University -// -// ====================================================================== - -// CGAL_CFG_NO_ITERATOR_TRAITS.C -// --------------------------------------------------------------------- -// A short test program to evaluate a C++ compiler. -// This program is used by cgal_configure. -// The following documentation will be pasted in the generated configfile. -// --------------------------------------------------------------------- - -//| The class std::iterator_traits is part of the std library. -//| It is used to access certain properties of iterators, such as -//| their value type or iterator category (forward, bidirectional, etc.). -//| The macro CGAL_CFG_NO_ITERATOR_TRAITS is set if std::iterator_traits -//| is not fully supported. - -#include -#include - -#if defined(__sun) && defined(__SUNPRO_CC) -// For sunpro 5.3 we fake it, since it can do partial specialization -// but ships a non-compliant std library for backwards compatibility. -namespace std { - template struct iterator_traits - { - typedef _TYPENAME Iterator::value_type value_type; - typedef _TYPENAME Iterator::difference_type difference_type; - typedef _TYPENAME Iterator::pointer pointer; - typedef _TYPENAME Iterator::reference reference; - typedef _TYPENAME Iterator::iterator_category iterator_category; - }; - template struct iterator_traits - { - typedef T value_type; - typedef ptrdiff_t difference_type; - typedef T* pointer; - typedef T& reference; - typedef random_access_iterator_tag iterator_category; - }; - template struct iterator_traits - { - typedef T value_type; - typedef ptrdiff_t difference_type; - typedef const T* pointer; - typedef const T& reference; - typedef random_access_iterator_tag iterator_category; - }; -} -#endif // defined(__sun) && defined(__SUNPRO_CC) - -// This class implements an iterator adaptor that forwards all -// member function calls to its template argument. It uses -// iterator traits to derive correct types and iterator category. - -#ifdef _MSC_VER -using namespace std; // MSC hates "using std::{blah};".... -# if _MSC_VER < 1300 -# define typename // preventing MSVC 6.0 "error C2899: - // typename cannot be used outside a template -# endif // MSVC 6.0 -#else -using std::iterator_traits; -#endif // _MSC_VER - -template < class I, - class category = typename iterator_traits::iterator_category > -class Adaptor { - I _i; -public: - typedef typename iterator_traits::value_type value_type; - typedef typename iterator_traits::difference_type difference_type; - typedef typename iterator_traits::reference reference; - typedef typename iterator_traits::pointer pointer; - typedef category iterator_category; - Adaptor( I i) : _i(i) {} - Adaptor& - operator++() { - ++_i; - return *this; - } - reference - operator*() const { - return *_i; - } -}; - -// A global function to extract the iterator category. - -template < class I> inline -typename iterator_traits::iterator_category -query( I) { - typedef typename iterator_traits::iterator_category IC; - return IC(); -} - -// A function to match bidirectional iterators. -inline -int discr( std::bidirectional_iterator_tag ) { return 42; } - -bool all_assertions_correct = true; - -int main() { - std::vector v; - v.push_back(32); - v.push_back(33); - v.push_back(42); - Adaptor< std::vector::iterator> i( v.begin()); - ++i; - all_assertions_correct &= ( *i == 33); - ++i; - all_assertions_correct &= ( *i == 42); - all_assertions_correct &= ( discr( query( i)) == 42); - return !all_assertions_correct; -} - diff --git a/Packages/Configuration/config/testfiles/CGAL_CFG_NO_NESTED_TEMPLATE_KEYWORD.C b/Packages/Configuration/config/testfiles/CGAL_CFG_NO_NESTED_TEMPLATE_KEYWORD.C deleted file mode 100644 index 1b62cac3692..00000000000 --- a/Packages/Configuration/config/testfiles/CGAL_CFG_NO_NESTED_TEMPLATE_KEYWORD.C +++ /dev/null @@ -1,50 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 1999 The CGAL Consortium -// -// This software and related documentation is part of an INTERNAL release -// of the Computational Geometry Algorithms Library (CGAL). It is not -// intended for general use. -// -// ---------------------------------------------------------------------- -// -// release : -// release_date : -// -// file : config/testfiles/CGAL_CFG_NO_NESTED_TEMPLATE_KEYWORD.C -// author(s) : various -// -// coordinator : Utrecht University -// -// ====================================================================== - -// CGAL_CFG_NO_NESTED_TEMPLATE_KEYWORD.C -// --------------------------------------------------------------------- -// A short test program to evaluate a C++ compiler. -// This program is used by cgal_configure. -// The following documentation will be pasted in the generated configfile. -// --------------------------------------------------------------------- - -//| This flag is set, if a compiler does not accept the template -//| keyword when referring to nested template classes. -//| E.g. if the templated class C is defined within class A, -//| one refers to it by A::template C< >. - - -struct A { - template < class T > - struct C {}; -}; - -template < class T > -struct B { - typedef typename T::template C< int > C; -}; - -int main() { - B< A > b; - (void)(b); - return 0; -} - -// EOF // diff --git a/Packages/Configuration/config/testfiles/CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS.C b/Packages/Configuration/config/testfiles/CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS.C deleted file mode 100644 index 6296e62442e..00000000000 --- a/Packages/Configuration/config/testfiles/CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS.C +++ /dev/null @@ -1,60 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 1997 The CGAL Consortium -// -// ---------------------------------------------------------------------- -// -// release : -// release_date : -// -// file : config/testfiles/CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS.C -// source : -// revision : 1.11 -// revision_date : 29 Mar 1998 -// author(s) : various -// -// coordinator : Utrecht University -// -// ====================================================================== - -// CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS.C -// --------------------------------------------------------------------- -// A short test program to evaluate a C++ compiler. -// This program is used by cgal_configure. -// The following documentation will be pasted in the generated configfile. -// --------------------------------------------------------------------- - -//| The parameter types of member functions might contain a scope -//| operator. This works as long as the member function is implemented -//| inline in the class. If the member function is implemented external -//| not all compilers are able to parse the scope operators correctly. -//| The following definition is set if the compiler fails parsing. - - - -template < class T> -struct A { - typedef T X; -}; - -template< class T> -struct B { - typename T::X foo( typename T::X i); -}; - - -template< class T> -typename T::X B::foo( typename T::X i) { - return i + 2; -} - -bool all_assertions_correct = true; - -int main() { - B > b; - all_assertions_correct &= ( b.foo(40) == 42); - return !all_assertions_correct; -} - -// EOF // - diff --git a/Packages/Configuration/config/testfiles/CGAL_CFG_NO_TEMPLATE_FRIEND_DISTINCTION.C b/Packages/Configuration/config/testfiles/CGAL_CFG_NO_TEMPLATE_FRIEND_DISTINCTION.C deleted file mode 100644 index d1c5279c5c6..00000000000 --- a/Packages/Configuration/config/testfiles/CGAL_CFG_NO_TEMPLATE_FRIEND_DISTINCTION.C +++ /dev/null @@ -1,48 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 1999 The CGAL Consortium -// -// ---------------------------------------------------------------------- -// -// release : -// release_date : -// -// file : config/testfiles/CGAL_CFG_NO_TEMPLATE_FRIEND_DISTINCTION.C -// source : -// revision : 1.11 -// revision_date : 29 Mar 1998 -// author(s) : various -// -// coordinator : Utrecht University -// -// ====================================================================== - -// CGAL_CFG_NO_TEMPLATE_FRIEND_DISTINCTION.C -// --------------------------------------------------------------------- -// A short test program to evaluate a C++ compiler. -// This program is used by cgal_configure. -// The following documentation will be pasted in the generated configfile. -// --------------------------------------------------------------------- - -//| Checks whether the compiler wants to have a <> in friend declarations -//| of template functions. - -template < class T > -inline int y(T t); - -struct A { - A(int i_) : i(i_) {} - friend int y<>(A); -private: - int i; -}; - -template < class T > -int y(T t) { return t.i - 1; } - -int main() -{ - A a(3); - return (y(a) == 2)?0:1; -} - diff --git a/Packages/Configuration/config/testfiles/CGAL_CFG_SUNPRO_PARTIAL_SPEC_BUG.C b/Packages/Configuration/config/testfiles/CGAL_CFG_SUNPRO_PARTIAL_SPEC_BUG.C deleted file mode 100644 index daa36f96b98..00000000000 --- a/Packages/Configuration/config/testfiles/CGAL_CFG_SUNPRO_PARTIAL_SPEC_BUG.C +++ /dev/null @@ -1,55 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 2001 The CGAL Consortium -// -// This software and related documentation is part of an INTERNAL release -// of the Computational Geometry Algorithms Library (CGAL). It is not -// intended for general use. -// -// ---------------------------------------------------------------------- -// -// release : -// release_date : -// -// file : config/testfiles/CGAL_CFG_SUNPRO_PARTIAL_SPEC_BUG.C -// package : Configuration (2.3) -// author(s) : Lutz & Sylvain -// -// coordinator : Utrecht University -// -// ====================================================================== - -// CGAL_CFG_SUNPRO_PARTIAL_SPEC_BUG.C -// --------------------------------------------------------------------- -// A short test program to evaluate a C++ compiler. -// This program is used by cgal_configure. -// The following documentation will be pasted in the generated configfile. -// --------------------------------------------------------------------- - -//| This is a test-case for a bug in SunPro 5.3 that occurs in the HDS. -//| When the bug is present, CGAL_CFG_SUNPRO_PARTIAL_SPEC_BUG is set. - -template < class Refs, class D = int > -struct Halfedge_base; - -template < class Refs > -struct Halfedge_base { - typedef Halfedge_base Base; - void set_vertex( ) { } -}; - -struct HDS { - typedef Halfedge_base Halfedge; - typedef Halfedge::Base HBase; - - void create_pair() { - Halfedge h; - h.HBase::set_vertex(); - } -}; - -int main() { - HDS hds; - hds.create_pair(); - return 0; -} diff --git a/Packages/Configuration/config/testfiles/CGAL_CFG_TYPENAME_BUG.C b/Packages/Configuration/config/testfiles/CGAL_CFG_TYPENAME_BUG.C deleted file mode 100644 index efc9f32ba88..00000000000 --- a/Packages/Configuration/config/testfiles/CGAL_CFG_TYPENAME_BUG.C +++ /dev/null @@ -1,47 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 1999 The CGAL Consortium -// -// This software and related documentation is part of an INTERNAL release -// of the Computational Geometry Algorithms Library (CGAL). It is not -// intended for general use. -// -// ---------------------------------------------------------------------- -// -// release : -// release_date : -// -// file : config/testfiles/CGAL_CFG_TYPENAME_BUG.C -// author(s) : various -// -// coordinator : Utrecht University -// -// ====================================================================== - -// CGAL_CFG_TYPENAME_BUG.C -// --------------------------------------------------------------------- -// A short test program to evaluate a C++ compiler. -// This program is used by cgal_configure. -// The following documentation will be pasted in the generated configfile. -// --------------------------------------------------------------------- - -//| If a compiler complains about typename, when passing a dependent -//| type as template parameter, the flag CGAL_CFG_TYPENAME_BUG is set. - -template < class T > struct Zap {}; - -struct TT { typedef int O; }; - -template < class T > -void foo(T) -{ - typedef Zap< typename T::O > O; -} - -int main() -{ - TT t; - foo(t); - return 0; -} - diff --git a/Packages/Configuration/config/testfiles/CGAL_CFG_USING_USING_BUG.C b/Packages/Configuration/config/testfiles/CGAL_CFG_USING_USING_BUG.C deleted file mode 100644 index eca65a120e9..00000000000 --- a/Packages/Configuration/config/testfiles/CGAL_CFG_USING_USING_BUG.C +++ /dev/null @@ -1,41 +0,0 @@ -// ====================================================================== -// -// Copyright (c) 1999 The CGAL Consortium -// -// This software and related documentation is part of an INTERNAL release -// of the Computational Geometry Algorithms Library (CGAL). It is not -// intended for general use. -// -// ---------------------------------------------------------------------- -// -// release : $CGAL_Revision: CGAL-2.2-I-20 $ -// release_date : $CGAL_Date: 2000/06/02 $ -// -// file : config/testfiles/CGAL_CFG_USING_USING_BUG.C -// package : Configuration (2.3) -// author(s) : various -// -// coordinator : Utrecht University -// -// ====================================================================== - -// CGAL_CFG_USING_USING_BUG.C -// --------------------------------------------------------------------- -// A short test program to evaluate a C++ compiler. -// This program is used by cgal_configure. -// The following documentation will be pasted in the generated configfile. -// --------------------------------------------------------------------- - -//| If a compiler does not accept a using declaration referring to a -//| symbol that is again declared by a using declaration, the flag -//| CGAL_CFG_USING_USING_BUG is set. - -namespace L { int foo() { return 0; } } -namespace M { using L::foo; } -namespace N { using M::foo; } - -int main() -{ - return N::foo(); -} - diff --git a/Packages/Configuration/include/CGAL/config.h b/Packages/Configuration/include/CGAL/config.h index 212d074d9df..c786a88e1c3 100644 --- a/Packages/Configuration/include/CGAL/config.h +++ b/Packages/Configuration/include/CGAL/config.h @@ -139,12 +139,12 @@ #endif // ! CGAL_USE_NEWSTYLE_HEADERS //--------------------------------------------------------------------// -// if defined CGAL_CFG_NOMINMAX_BUG define NOMINMAX flag +// This addresses a bug in VC++ 7.0 that (re)defines min(a, b) +// and max(a, b) in windows.h and windef.h //-------------------------------------------------------------------// -#ifdef CGAL_CFG_NOMINMAX_BUG +#ifdef _MSC_VER #define NOMINMAX 1 #endif #endif // CGAL_CONFIG_H -