ardour
visibility.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2013 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __libevoral_visibility_h__
21 #define __libevoral_visibility_h__
22 
23 #if defined(COMPILER_MSVC)
24  #define LIBEVORAL_DLL_IMPORT __declspec(dllimport)
25  #define LIBEVORAL_DLL_EXPORT __declspec(dllexport)
26  #define LIBEVORAL_DLL_LOCAL
27  #define LIBEVORAL_TEMPLATE_DLL_IMPORT __declspec(dllimport)
28  #define LIBEVORAL_TEMPLATE_DLL_EXPORT __declspec(dllexport)
29 #else
30  #define LIBEVORAL_DLL_IMPORT __attribute__ ((visibility ("default")))
31  #define LIBEVORAL_DLL_EXPORT __attribute__ ((visibility ("default")))
32  #define LIBEVORAL_DLL_LOCAL __attribute__ ((visibility ("hidden")))
33  #define LIBEVORAL_TEMPLATE_DLL_IMPORT __attribute__ ((visibility ("default")))
34  #define LIBEVORAL_TEMPLATE_DLL_EXPORT __attribute__ ((visibility ("default")))
35 #endif
36 
37 #ifdef LIBEVORAL_STATIC // libevoral is not a DLL
38  #define LIBEVORAL_API
39  #define LIBEVORAL_LOCAL
40 #else
41  #ifdef LIBEVORAL_DLL_EXPORTS // defined if we are building the libevoral DLL (instead of using it)
42  #define LIBEVORAL_API LIBEVORAL_DLL_EXPORT
43  #define LIBEVORAL_TEMPLATE_API LIBEVORAL_TEMPLATE_DLL_EXPORT
44  #else
45  #define LIBEVORAL_API LIBEVORAL_DLL_IMPORT
46  #define LIBEVORAL_TEMPLATE_API LIBEVORAL_TEMPLATE_DLL_IMPORT
47  #endif
48  #define LIBEVORAL_LOCAL LIBEVORAL_DLL_LOCAL
49 #endif
50 
51 #endif /* __libevoral_visibility_h__ */