This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] pure.cc standardization.
- To: gcc-patches at gcc dot gnu dot org
- Subject: [v3] pure.cc standardization.
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Fri, 26 Jan 2001 18:32:14 -0800
Is there any reason to use something besides fputs here? I can't think
of one. If not, can this get checked in?
tested on x86/linux
2001-01-26 Benjamin Kosnik <bkoz@kredhat.com>
* libsupc++/pure.cc (writestr): Just use cstdio and std::fputs.
Index: libsupc++/pure.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/pure.cc,v
retrieving revision 1.3
diff -c -p -r1.3 pure.cc
*** pure.cc 2000/11/19 21:07:24 1.3
--- pure.cc 2001/01/27 02:30:23
***************
*** 1,5 ****
// -*- C++ -*-
! // Copyright (C) 2000 Free Software Foundation
//
// This file is part of GNU CC.
//
--- 1,5 ----
// -*- C++ -*-
! // Copyright (C) 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
***************
*** 28,47 ****
// the GNU General Public License.
#include <bits/c++config.h>
- #ifdef _GLIBCPP_HAVE_UNISTD_H
- # include <unistd.h>
- # define writestr(str) write(2, str, sizeof(str) - 1)
- # ifdef __GNU_LIBRARY__
- /* Avoid forcing the library's meaning of `write' on the user program
- by using the "internal" name (for use within the library). */
- /*# define write(fd, buf, n) __write((fd), (buf), (n))*/
- # endif
- #else
- # include <stdio.h>
- # define writestr(str) fputs(str, stderr)
- #endif
-
extern "C" {
extern void __terminate(void) __attribute__ ((__noreturn__));
--- 28,35 ----
// the GNU General Public License.
#include <bits/c++config.h>
+ # include <cstdio>
extern "C" {
extern void __terminate(void) __attribute__ ((__noreturn__));
*************** extern void __terminate(void) __attribut
*** 57,63 ****
void
PURE_VIRTUAL_NAME (void)
{
! writestr ("pure virtual method called\n");
__terminate ();
}
--- 45,51 ----
void
PURE_VIRTUAL_NAME (void)
{
! std::fputs ("pure virtual method called\n", stderr);
__terminate ();
}