Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / tagdemo / foo.cpp
1 // -*- C++ -*-
2 //    foo.cpp -- trivial test library
3 //
4 //    Copyright (C) 1998-2000, 2007 Free Software Foundation, Inc.
5 //    Written by Thomas Tanner, 1998
6 //
7 //    This file is part of GNU Libtool.
8 //
9 // GNU Libtool is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of
12 // the License, or (at your option) any later version.
13 //
14 // GNU Libtool is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with GNU Libtool; see the file COPYING.  If not, a copy
21 // can be downloaded from  http://www.gnu.org/licenses/gpl.html,
22 // or obtained by writing to the Free Software Foundation, Inc.,
23 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
25 #include "foo.h"
26 #ifdef HAVE_IOSTREAM
27 # include <iostream>
28 #else
29 # include <iostream.h>
30 #endif
31 #ifdef HAVE_NAMESPACES
32 namespace std { }
33 using namespace std;
34 #endif
35
36 #include <math.h>
37
38 // Our C functions.
39 int
40 foo(void)
41 {
42   cout << "cos (0.0) = " << (double) cos ((double) 0.0) << endl;
43   return FOO_RET;
44 }
45
46 int
47 hello(void)
48 {
49   cout << "** This is libfoo (tagdemo) **" << endl;
50   return HELLO_RET;
51 }
52
53
54 // --------------------------------------------------------------------
55 // Our C++ derived class methods.
56
57
58 int
59 foobar_derived::foo(void)
60 {
61   return ::foo();
62 }
63
64 int
65 foobar_derived::hello(void)
66 {
67   return ::hello();
68 }