2 * Cross platform defines for exporting symbols from shared libraries
4 * Wireshark - Network traffic analyzer
5 * By Balint Reczey <balint@balintreczey.hu>
6 * Copyright 2013 Balint Reczey
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program 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.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef SYMBOL_EXPORT_H
24 #define SYMBOL_EXPORT_H
26 /* Originally copied from GCC Wiki at http://gcc.gnu.org/wiki/Visibility */
27 #if defined _WIN32 || defined __CYGWIN__
30 #define WS_DLL_PUBLIC __attribute__ ((dllexport))
31 #else /* ! __GNUC__ */
32 #define WS_DLL_PUBLIC __declspec(dllexport) /* Note: actually gcc seems to also support this syntax. */
36 #define WS_DLL_PUBLIC __attribute__ ((dllimport))
37 #elif ! (defined ENABLE_STATIC) /* ! __GNUC__ */
38 #define WS_DLL_PUBLIC __declspec(dllimport) /* Note: actually gcc seems to also support this syntax. */
39 #else /* ! __GNUC__ && ENABLE_STATIC */
42 #endif /* WS_BUILD_DLL */
46 #define WS_DLL_PUBLIC __attribute__ ((visibility ("default")))
47 #define WS_DLL_LOCAL __attribute__ ((visibility ("hidden")))
48 #else /* ! __GNUC__ >= 4 */
51 #endif /* __GNUC__ >= 4 */
54 #endif /* SYMBOL_EXPORT_H */