]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tagdemo/foo.cpp: Use C++ IO to catch problems linking to C++
authorRobert Boehne <rboehne@gnu.org>
Mon, 1 Apr 2002 21:59:09 +0000 (21:59 +0000)
committerRobert Boehne <rboehne@gnu.org>
Mon, 1 Apr 2002 21:59:09 +0000 (21:59 +0000)
runtime libraries.
* tagdemo/main.cpp: Ditto.

ChangeLog
tagdemo/foo.cpp
tagdemo/main.cpp

index 75c23cad7175a96b6f33115d0ed3d9b86556feaa..80b4370b00bce7344ac2715bfe72ef414f4383c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 734e2a9d9b5f9b153bf6c7433b2207d148648b8c..ee183cf161f8e81ce763fe67fae0e35dc24d9699 100644 (file)
@@ -20,7 +20,7 @@
 // USA.
 
 #include "foo.h"
-#include <stdio.h>
+#include <iostream.h>
 
 #ifdef HAVE_MATH_H
 #include <math.h>
 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;
 }
 
index 6f1e16ddad86f793f901a3a194a2b3bef8718ac4..676acecae853ccbde78fe263625866f21ebbfc0f 100644 (file)
 
 #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;
 }