This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: patch: <bits/localefwd.h> with -fno-exceptions
On Fre, 16 Feb 2001, Benjamin Kosnik wrote:
> > I'll start testing your patch, but I hope it's going into the gcc 3 release.
> hell yes. That was the point of doing it.
It still does not work. below a patch with trivial changes to make basic
programs work. Those who use STL string still don't work because
bits/basic_string.tcc contains a lot of eh related statements. I'm not sure
what to do with them. I guess those try/catch blocks ought to be replaced
with an if and a __throw_xxx call ?
Dirk
Index: lang-specs.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/lang-specs.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -d -p -C2 -r1.39 -r1.40
*** lang-specs.h 2001/02/12 07:35:05 1.39
--- lang-specs.h 2001/02/13 13:11:40 1.40
***************
*** 1,4 ****
/* Definitions for specs for C++.
! Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
--- 1,4 ----
/* Definitions for specs for C++.
! Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
*************** Boston, MA 02111-1307, USA. */
*** 39,42 ****
--- 39,43 ----
%{save-temps:cpp0 -lang-c++ -D_GNU_SOURCE \
%{!no-gcc:-D__GNUG__=%v1}\
+ %{!fno-exceptions:-D__EXCEPTIONS}\
%{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
%{ansi:-D__STRICT_ANSI__ -trigraphs -$}\
*************** Boston, MA 02111-1307, USA. */
*** 45,48 ****
--- 46,50 ----
%{!save-temps:%(cpp_options)\
%{!no-gcc:-D__GNUG__=%v1} -D_GNU_SOURCE \
+ %{!fno-exceptions:-D__EXCEPTIONS}\
%{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
%{ansi:-D__STRICT_ANSI__}}\
Index: stl_config.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_config.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -d -p -C2 -r1.3 -r1.4
*** stl_config.h 2000/11/25 19:36:53 1.3
--- stl_config.h 2001/02/16 00:42:20 1.4
***************
*** 266,270 ****
# define __STL_HAS_NAMESPACES
# define __STL_USE_NAMESPACES
! # define __STL_USE_EXCEPTIONS
# define __STL_THROW_RANGE_ERRORS
# define __STL_CAN_THROW_RANGE_ERRORS
--- 266,272 ----
# define __STL_HAS_NAMESPACES
# define __STL_USE_NAMESPACES
! # ifdef __EXCEPTIONS
! # define __STL_USE_EXCEPTIONS
! # endif
# define __STL_THROW_RANGE_ERRORS
# define __STL_CAN_THROW_RANGE_ERRORS
Index: localefwd.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/localefwd.h,v
retrieving revision 1.11
diff -d -p -r1.11 localefwd.h
*** localefwd.h 2001/02/07 20:26:24 1.11
--- localefwd.h 2001/02/17 03:18:13
***************
*** 35,44 ****
#define _CPP_BITS_LOCCORE_H 1
#include <bits/c++config.h>
#include <bits/std_climits.h> // For CHAR_BIT
#include <bits/std_string.h> // For string
#include <bits/std_cctype.h> // For isspace, etc.
! #include <bits/c++locale.h> // Defines __c_locale.
namespace std
{
--- 35,45 ----
#define _CPP_BITS_LOCCORE_H 1
#include <bits/c++config.h>
+ #include <bits/c++locale.h> // Defines __c_locale.
#include <bits/std_climits.h> // For CHAR_BIT
#include <bits/std_string.h> // For string
#include <bits/std_cctype.h> // For isspace, etc.
! #include <bits/stl_config.h>
namespace std
{
*************** namespace std
*** 354,363 ****
{
if (_M_references-- == 0) // XXX MT
{
! try
{ delete this; }
! catch(...)
! { }
}
}
--- 355,363 ----
{
if (_M_references-- == 0) // XXX MT
{
! __STL_TRY
{ delete this; }
! __STL_CATCH_ALL { }
}
}