Debian Codegraph @

include/fcml_lib_export.h

raw
1 /*
2 * FCML - Free Code Manipulation Library.
3 * Copyright (C) 2010-2021 Slawomir Wojtasiak
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 /** @file fcml_lib_export.h
21 * Handles Win32 DLL symbols importing/exporting.
22 * The only interesting thing here is the LIBFCML_DLL_IMPORT symbol which has to
23 * be always defined in order to use dynamic DLL under Windows. You can achieve it
24 * by declaring the symbol before this header file is included. For example:
25 * @code
26 * #define LIBFCML_DLL_IMPORT
27 * #include <fcml_lib_export.h>
28 * @endcode
29 * Take into account that this header file is included by every FCML public header, so
30 * in fact you should define the symbol before including anything from the FCML library.
31 * This declaration can be omitted as long as you use undecorated symbol names.
32 *
33 * @copyright Copyright (C) 2010-2021 Slawomir Wojtasiak. All rights reserved.
34 * This project is released under the GNU Lesser General Public License.
35 */
36
37 #ifndef FCML_LIB_EXPORT_H_
38 #define FCML_LIB_EXPORT_H_
39
40 #ifdef HAVE_CONFIG_H
41 #include <config.h>
42 #endif
43
44 #if _WIN32 || __CYGWIN__
45 #define LIB_CALL __stdcall
46 #ifdef DLL_EXPORT
47 #define LIB_EXPORT __declspec(dllexport)
48 #else
49 #ifdef LIBFCML_DLL_IMPORT
50 #define LIB_EXPORT __declspec(dllimport)
51 #endif
52 #endif
53 #endif
54
55 #ifndef LIB_EXPORT
56 #ifdef SUPPORT_VISIBILITY_HIDDEN
57 #define LIB_EXPORT __attribute__((visibility("default")))
58 #else
59 #define LIB_EXPORT
60 #endif
61 #endif
62
63 #ifndef LIB_CALL
64 #define LIB_CALL
65 #endif
66
67 #endif /* FCML_LIB_EXPORT_H_ */