libsidplayfp  2.12.0
sidplayfp/siddefs.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2011-2023 Leandro Nini <drfiemost@users.sourceforge.net>
5  * Copyright 2007-2010 Antti Lankila
6  * Copyright 2000-2001 Simon White
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
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.
17  *
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.
21  */
22 
23 #ifndef SIDDEFS_H
24 #define SIDDEFS_H
25 
26 /* DLL building support on win32 hosts */
27 #ifndef SID_EXTERN
28 # ifdef DLL_EXPORT /* defined by libtool (if required) */
29 # define SID_EXTERN __declspec(dllexport)
30 # endif
31 # ifdef SID_DLL_IMPORT /* define if linking with this dll */
32 # define SID_EXTERN __declspec(dllimport)
33 # endif
34 # ifndef SID_EXTERN /* static linking or !_WIN32 */
35 # if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
36 # define SID_EXTERN __attribute__ ((visibility("default")))
37 # else
38 # define SID_EXTERN
39 # endif
40 # endif
41 #endif
42 
43 /* Deprecated attributes */
44 #if __cplusplus >= 201402L
45 # define SID_DEPRECATED [[deprecated]]
46 #elif defined(_MSCVER)
47 # define SID_DEPRECATED __declspec(deprecated)
48 #elif defined(__GNUC__) || defined(__clang__)
49 # define SID_DEPRECATED __attribute__ ((deprecated))
50 #else
51 # define SID_DEPRECATED
52 #endif
53 
54 /* Unused attributes */
55 #if __cplusplus >= 201703L
56 # define SID_UNUSED [[maybe_unused]]
57 #elif defined(__GNUC__) || defined(__clang__)
58 # define SID_UNUSED __attribute__ ((unused))
59 #else
60 # define SID_UNUSED
61 #endif
62 
63 #endif /* SIDDEFS_H */