Removed obsolete config testfiles.

This commit is contained in:
Michael Hoffmann 2003-05-05 18:33:49 +00:00
parent 718cadba89
commit 91fba533e8
10 changed files with 7 additions and 480 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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 <iterator>
#include <vector>
#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 <class Iterator> 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 <class T> struct iterator_traits<T*>
{
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
typedef random_access_iterator_tag iterator_category;
};
template <class T> struct iterator_traits<const T*>
{
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<I>::iterator_category >
class Adaptor {
I _i;
public:
typedef typename iterator_traits<I>::value_type value_type;
typedef typename iterator_traits<I>::difference_type difference_type;
typedef typename iterator_traits<I>::reference reference;
typedef typename iterator_traits<I>::pointer pointer;
typedef category iterator_category;
Adaptor( I i) : _i(i) {}
Adaptor<I, category>&
operator++() {
++_i;
return *this;
}
reference
operator*() const {
return *_i;
}
};
// A global function to extract the iterator category.
template < class I> inline
typename iterator_traits<I>::iterator_category
query( I) {
typedef typename iterator_traits<I>::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<int> v;
v.push_back(32);
v.push_back(33);
v.push_back(42);
Adaptor< std::vector<int>::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;
}

View File

@ -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 //

View File

@ -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<T>::foo( typename T::X i) {
return i + 2;
}
bool all_assertions_correct = true;
int main() {
B<A<int> > b;
all_assertions_correct &= ( b.foo(40) == 42);
return !all_assertions_correct;
}
// EOF //

View File

@ -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;
}

View File

@ -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 <Refs, int> {
typedef Halfedge_base<Refs> Base;
void set_vertex( ) { }
};
struct HDS {
typedef Halfedge_base<int> Halfedge;
typedef Halfedge::Base HBase;
void create_pair() {
Halfedge h;
h.HBase::set_vertex();
}
};
int main() {
HDS hds;
hds.create_pair();
return 0;
}

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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