From: Robert Boehne Date: Mon, 1 Apr 2002 21:59:09 +0000 (+0000) Subject: * tagdemo/foo.cpp: Use C++ IO to catch problems linking to C++ X-Git-Tag: release-1-5~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba7de179d0ca95790670ee37577b6a4f4df323b5;p=thirdparty%2Flibtool.git * tagdemo/foo.cpp: Use C++ IO to catch problems linking to C++ runtime libraries. * tagdemo/main.cpp: Ditto. --- diff --git a/ChangeLog b/ChangeLog index 75c23cad7..80b4370b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-04-01 Robert Boehne + + * tagdemo/foo.cpp: Use C++ IO to catch problems linking to C++ + runtime libraries. + * tagdemo/main.cpp: Ditto. + 2002-03-16 Gary V. Vaughan * TODO: Removed obsolete comments about RMS' package system. diff --git a/tagdemo/foo.cpp b/tagdemo/foo.cpp index 734e2a9d9..ee183cf16 100644 --- a/tagdemo/foo.cpp +++ b/tagdemo/foo.cpp @@ -20,7 +20,7 @@ // USA. #include "foo.h" -#include +#include #ifdef HAVE_MATH_H #include @@ -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; } diff --git a/tagdemo/main.cpp b/tagdemo/main.cpp index 6f1e16dda..676acecae 100644 --- a/tagdemo/main.cpp +++ b/tagdemo/main.cpp @@ -22,13 +22,13 @@ #include "foo.h" #include "baz.h" -#include +#include 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; }