* tagdemo/foo.cpp: Use C++ IO to catch problems linking to C++

runtime libraries.
* tagdemo/main.cpp: Ditto.
This commit is contained in:
Robert Boehne 2002-04-01 21:59:09 +00:00
parent a4591395cd
commit ba7de179d0
3 changed files with 15 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2002-04-01 Robert Boehne <rboehne@gnu.org>
* tagdemo/foo.cpp: Use C++ IO to catch problems linking to C++
runtime libraries.
* tagdemo/main.cpp: Ditto.
2002-03-16 Gary V. Vaughan <gary@gnu.org>
* TODO: Removed obsolete comments about RMS' package system.

View File

@ -20,7 +20,7 @@
// USA.
#include "foo.h"
#include <stdio.h>
#include <iostream.h>
#ifdef HAVE_MATH_H
#include <math.h>
@ -30,14 +30,14 @@
int
foo(void)
{
printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
cout << "cos (0.0) = " << (double) cos ((double) 0.0) << endl;
return FOO_RET;
}
int
hello(void)
{
printf ("** This is libfoo (tagdemo) **\n");
cout << "** This is libfoo (tagdemo) **" << endl;
return HELLO_RET;
}

View File

@ -22,13 +22,13 @@
#include "foo.h"
#include "baz.h"
#include <stdio.h>
#include <iostream.h>
int
main (int, char *[])
{
printf ("Welcome to GNU libtool tagdemo!\n");
cout << "Welcome to GNU libtool tagdemo C++!" << endl;
foobar_derived FB;
// Instantiate the derived class.
@ -38,12 +38,12 @@ main (int, char *[])
int value = fb->hello();
printf ("foobar::hello returned: %i\n", value);
cout << "foobar::hello returned: " << value << endl;
if (value == HELLO_RET)
printf("foobar::hello is ok!\n");
cout << "foobar::hello is ok!" << endl;
if (fb->foo() == FOO_RET)
printf("foobar::foo is ok!\n");
cout << "foobar::foo is ok!" << endl;
// --------------
@ -57,7 +57,7 @@ main (int, char *[])
// barbaz_derived::baz() should return FOO_RET since it calls
// foobar_derived::foo(), which in turn calls ::foo().
if (bb->baz() == FOO_RET)
printf("barbaz::baz is ok!\n");
cout << "barbaz::baz is ok!" << endl;
return 0;
}