Remove obsolete config flag CGAL_CFG_NO_LOCALE.

This commit is contained in:
Sylvain Pion 2007-08-08 15:30:58 +00:00
parent a90de08bf3
commit d76beea6ad
8 changed files with 18 additions and 139 deletions

View File

@ -1,38 +0,0 @@
// Copyright (c) 1997 Utrecht University (The Netherlands),
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : various
// ---------------------------------------------------------------------
// A short test program to evaluate a C++ compiler.
// This program is used by install_cgal.
// The following documentation will be pasted in the generated configfile.
// ---------------------------------------------------------------------
//| If a compiler doesn't know the locale classic
//| CGAL_CFG_NO_LOCALE is set.
#include <locale>
int main()
{
return std::isspace(' ', std::locale::classic()) ? 0 : 1;
}

View File

@ -180,11 +180,7 @@ std::istream &operator>>(std::istream &in,
do {
in >> c;
}
#ifndef CGAL_CFG_NO_LOCALE
while (std::isspace(c,std::locale::classic() ));
#else
while (std::isspace(c));
#endif
if (c != ',') {
in.setstate(std::ios_base::failbit);

View File

@ -178,11 +178,7 @@ std::istream &operator>>(std::istream &in,
do {
in >> c;
}
#ifndef CGAL_CFG_NO_LOCALE
while (std::isspace(c,std::locale::classic() ));
#else
while (std::isspace(c));
#endif
if (c != ',') {
in.setstate(std::ios_base::failbit);

View File

@ -135,11 +135,7 @@ std::istream &operator>>(std::istream &in,
do {
in >> c;
}
#ifndef CGAL_CFG_NO_LOCALE
while (std::isspace(c,std::locale::classic() ));
#else
while (std::isspace(c));
#endif
if (c != ',') {
in.setstate(std::ios_base::failbit);

View File

@ -304,14 +304,8 @@ namespace Gmpq_detail {
bool is_space (const std::istream& /*is*/, std::istream::int_type c)
{
std::istream::char_type cc= c;
return
(c == std::istream::traits_type::eof()) ||
#ifndef CGAL_CFG_NO_LOCALE
std::isspace(cc, std::locale::classic() )
#else
std::isspace(cc)
#endif
;
return (c == std::istream::traits_type::eof()) ||
std::isspace(cc, std::locale::classic() );
}
inline
@ -324,13 +318,7 @@ namespace Gmpq_detail {
bool is_digit (const std::istream& /*is*/, std::istream::int_type c)
{
std::istream::char_type cc= c;
return
#ifndef CGAL_CFG_NO_LOCALE
std::isdigit(cc, std::locale::classic() )
#else
std::isdigit(cc)
#endif
;
return std::isdigit(cc, std::locale::classic() );
}
}

View File

@ -33,11 +33,7 @@
#include <CGAL/Handle_for.h>
#include <string>
#ifndef CGAL_CFG_NO_LOCALE
# include <locale>
#else
# include <cctype>
#endif
#include <locale>
CGAL_BEGIN_NAMESPACE
@ -321,22 +317,17 @@ void gmpz_eat_white_space(std::istream &is)
std::istream::int_type c;
do {
c= is.peek();
if (c== std::istream::traits_type::eof()) return;
if (c== std::istream::traits_type::eof())
return;
else {
std::istream::char_type cc= c;
if (
#ifndef CGAL_CFG_NO_LOCALE
std::isspace(cc, std::locale::classic() )
#else
CGAL_CLIB_STD::isspace(cc)
#endif // CGAL_CFG_NO_LOCALE
) {
is.get();
// since peek succeeded, this should too
CGAL_assertion(!is.fail());
} else {
return;
}
if ( std::isspace(cc, std::locale::classic()) ) {
is.get();
// since peek succeeded, this should too
CGAL_assertion(!is.fail());
} else {
return;
}
}
} while (true);
}
@ -366,14 +357,8 @@ gmpz_new_read(std::istream &is, Gmpz &z)
std::istream::char_type cc= c;
if (c== std::istream::traits_type::eof()
||
#ifndef CGAL_CFG_NO_LOCALE
!std::isdigit(cc, std::locale::classic() )
#else
!std::isdigit(cc)
#endif // CGAL_CFG_NO_LOCALE) {
){
if (c== std::istream::traits_type::eof() ||
!std::isdigit(cc, std::locale::classic() ) ){
is.setstate(std::ios_base::failbit);
} else {
CGAL_assertion(cc==c);
@ -386,13 +371,7 @@ gmpz_new_read(std::istream &is, Gmpz &z)
break;
}
cc=c;
if (
#ifndef CGAL_CFG_NO_LOCALE
!std::isdigit(cc, std::locale::classic() )
#else
!std::isdigit(cc)
#endif // CGAL_CFG_NO_LOCALE
) {
if ( !std::isdigit(cc, std::locale::classic() )) {
break;
}
is.get();
@ -424,36 +403,20 @@ read_gmpz(std::istream& is, Gmpz &z) {
std::ios::fmtflags old_flags = is.flags();
is.unsetf(std::ios::skipws);
#ifndef CGAL_CFG_NO_LOCALE
while (is.get(c) && std::isspace(c, std::locale::classic() ))
#else
while (is.get(c) && CGAL_CLIB_STD::isspace(c))
#endif // CGAL_CFG_NO_LOCALE
{}
if (c == '-')
{
negative = true;
#ifndef CGAL_CFG_NO_LOCALE
while (is.get(c) && std::isspace(c, std::locale::classic() ))
#else
while (is.get(c) && CGAL_CLIB_STD::isspace(c))
#endif // CGAL_CFG_NO_LOCALE
{}
}
#ifndef CGAL_CFG_NO_LOCALE
if (std::isdigit(c, std::locale::classic() ))
#else
if (std::isdigit(c))
#endif // CGAL_CFG_NO_LOCALE
{
good = true;
tmp = c - null;
#ifndef CGAL_CFG_NO_LOCALE
while (is.get(c) && std::isdigit(c, std::locale::classic() ))
#else
while (is.get(c) && std::isdigit(c))
#endif // CGAL_CFG_NO_LOCALE
{
tmp = 10*tmp + (c-null);
}

View File

@ -34,11 +34,7 @@
#include <CGAL/Quotient.h> // spec of AST for Quotient<Gmpz>
#include <string>
#ifndef CGAL_CFG_NO_LOCALE
# include <locale>
#else
# include <cctype>
#endif
#include <locale>
#include <CGAL/Root_of_traits.h>

View File

@ -35,13 +35,7 @@
#define CGAL_QUOTIENT_H
#include <utility>
#ifndef CGAL_CFG_NO_LOCALE
# include <locale>
#else
# include <cctype>
#endif
#include <locale>
#include <CGAL/Interval_nt.h>
#include <CGAL/Kernel/mpl.h>
@ -377,11 +371,7 @@ operator>>(std::istream& in, Quotient<NT>& r)
char c = 0;
#ifndef CGAL_CFG_NO_LOCALE
while (in.get(c) && std::isspace(c, std::locale::classic() )) {}
#else
while (in.get(c) && CGAL_CLIB_STD::isspace(c)) {}
#endif // CGAL_CFG_NO_LOCALE
if ( !in ) return in;
in.putback(c);
@ -389,18 +379,10 @@ operator>>(std::istream& in, Quotient<NT>& r)
NT den(1);
in >> num;
#ifndef CGAL_CFG_NO_LOCALE
while (in.get(c) && std::isspace(c, std::locale::classic() )) {}
#else
while (in.get(c) && CGAL_CLIB_STD::isspace(c)) {}
#endif // CGAL_CFG_NO_LOCALE
if (( in ) && ( c == '/'))
{
#ifndef CGAL_CFG_NO_LOCALE
while (in.get(c) && std::isspace(c, std::locale::classic() )) {}
#else
while (in.get(c) && CGAL_CLIB_STD::isspace(c)) {}
#endif // CGAL_CFG_NO_LOCALE
CGAL_assertion( in );
in.putback(c);
in >> den;