Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / demo / foo.h
1 /* foo.h -- interface to the libfoo library
2
3    Copyright (C) 1996-1999, 2010 Free Software Foundation, Inc.
4    Written by Gord Matzigkeit, 1996
5
6    This file is part of GNU Libtool.
7
8 GNU Libtool is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of
11 the License, or (at your option) any later version.
12
13 GNU Libtool is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU Libtool; see the file COPYING.  If not, a copy
20 can be downloaded from  http://www.gnu.org/licenses/gpl.html,
21 or obtained by writing to the Free Software Foundation, Inc.,
22 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 */
24
25 /* Only include this header file once. */
26 #ifndef _FOO_H_
27 #define _FOO_H_ 1
28
29 /* At some point, cygwin will stop defining __CYGWIN32__, but b19 and
30  * earlier do not define __CYGWIN__.  This snippit allows us to check
31  * for __CYGWIN__ reliably for both current, old, and (probable) future
32  * releases.
33  */
34 #ifdef __CYGWIN32__
35 #  ifndef __CYGWIN__
36 #    define __CYGWIN__
37 #  endif
38 #endif
39
40 #if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
41 # ifdef BUILDING_LIBHELLO
42 #  ifdef DLL_EXPORT
43 #   define LIBHELLO_SCOPE extern __declspec (dllexport)
44 #  endif
45 # else
46 #  define LIBHELLO_SCOPE extern __declspec (dllimport)
47 # endif
48 #endif
49 #ifndef LIBHELLO_SCOPE
50 # define LIBHELLO_SCOPE extern
51 #endif
52
53 /* __BEGIN_DECLS should be used at the beginning of your declarations,
54    so that C++ compilers don't mangle their names.  Use __END_DECLS at
55    the end of C declarations. */
56 #undef __BEGIN_DECLS
57 #undef __END_DECLS
58 #ifdef __cplusplus
59 # define __BEGIN_DECLS extern "C" {
60 # define __END_DECLS }
61 #else
62 # define __BEGIN_DECLS /* empty */
63 # define __END_DECLS /* empty */
64 #endif
65
66 /* LTDL_PARAMS is a macro used to wrap function prototypes, so that compilers
67    that don't understand ANSI C prototypes still work, and ANSI C
68    compilers can issue warnings about type mismatches. */
69 #undef LTDL_PARAMS
70 #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(__CYGWIN__) || defined(__cplusplus)
71 # define LT_PARAMS(protos) protos
72 # define lt_ptr_t     void*
73 #else
74 # define LT_PARAMS(protos) ()
75 # define lt_ptr_t     char*
76 #endif
77
78 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
79 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
80 /* DATA imports from DLLs on WIN32 con't be const, because runtime
81    relocations are performed -- see ld's documentation on pseudo-relocs.  */
82 # define LT_DLSYM_CONST
83 #elif defined(__osf__)
84 /* This system does not cope well with relocations in const data.  */
85 # define LT_DLSYM_CONST
86 #else
87 # define LT_DLSYM_CONST const
88 #endif
89
90 /* Silly constants that the functions return. */
91 #define HELLO_RET 0xe110
92 #define FOO_RET 0xf00
93
94
95 /* Declarations.  Note the wonderful use of the above macros. */
96 __BEGIN_DECLS
97 int foo LT_PARAMS((void));
98 int hello LT_PARAMS((void));
99 LIBHELLO_SCOPE int nothing;
100 __END_DECLS
101
102 #endif /* !_FOO_H_ */