Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / pdemo / 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 __CYGWIN32__ reliably for both old and (probable) future releases.
32  */
33 #ifdef __CYGWIN__
34 #  ifndef __CYGWIN32__
35 #    define __CYGWIN32__
36 #  endif
37 #endif
38
39 /* __BEGIN_DECLS should be used at the beginning of your declarations,
40    so that C++ compilers don't mangle their names.  Use __END_DECLS at
41    the end of C declarations. */
42 #undef __BEGIN_DECLS
43 #undef __END_DECLS
44 #ifdef __cplusplus
45 # define __BEGIN_DECLS extern "C" {
46 # define __END_DECLS }
47 #else
48 # define __BEGIN_DECLS /* empty */
49 # define __END_DECLS /* empty */
50 #endif
51
52 /* LTDL_PARAMS is a macro used to wrap function prototypes, so that compilers
53    that don't understand ANSI C prototypes still work, and ANSI C
54    compilers can issue warnings about type mismatches. */
55 #undef LTDL_PARAMS
56 #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(__CYGWIN32__) || defined(__cplusplus)
57 # define LT_PARAMS(protos) protos
58 # define lt_ptr_t     void*
59 #else
60 # define LT_PARAMS(protos) ()
61 # define lt_ptr_t     char*
62 #endif
63
64 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
65 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
66 /* DATA imports from DLLs on WIN32 con't be const, because runtime
67    relocations are performed -- see ld's documentation on pseudo-relocs.  */
68 # define LT_DLSYM_CONST
69 #elif defined(__osf__)
70 /* This system does not cope well with relocations in const data.  */
71 # define LT_DLSYM_CONST
72 #else
73 # define LT_DLSYM_CONST const
74 #endif
75
76 #if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
77 # ifdef BUILDING_LIBHELLO
78 #  ifdef DLL_EXPORT
79 #   define LIBHELLO_SCOPE extern __declspec (dllexport)
80 #  endif
81 # else
82 #  define LIBHELLO_SCOPE extern __declspec (dllimport)
83 # endif
84 #endif
85 #ifndef LIBHELLO_SCOPE
86 # define LIBHELLO_SCOPE extern
87 #endif
88
89 /* Silly constants that the functions return. */
90 #define HELLO_RET 0xe110
91 #define FOO_RET 0xf00
92
93
94 /* Declarations.  Note the wonderful use of the above macros. */
95 __BEGIN_DECLS
96 int foo LT_PARAMS((void));
97 int foo2 LT_PARAMS((void));
98 int hello LT_PARAMS((void));
99 LIBHELLO_SCOPE int nothing;
100 __END_DECLS
101
102 #endif /* !_FOO_H_ */