common: prevent buffer overflow
[supercollider.git] / include / common / SC_Export.h
blobab183fa4c95d0116ec4893fb789fc6d28af0d17a
1 /*
2 SuperCollider real time audio synthesis system
3 Copyright (c) 2010 Tim Blechmann. All rights reserved.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _SC_EXPORTS_
21 #define _SC_EXPORTS_
23 #if defined _WIN32 || defined __CYGWIN__
24 # define SC_API_IMPORT __declspec(dllimport)
25 # define SC_API_EXPORT __declspec(dllexport)
26 #else
27 # if __GNUC__ >= 4
28 # define SC_API_IMPORT __attribute__ ((visibility("default")))
29 # define SC_API_EXPORT __attribute__ ((visibility("default")))
30 # else
31 # define SC_API_IMPORT
32 # define SC_API_EXPORT
33 # endif
34 #endif
36 #ifdef __cplusplus
37 # define C_LINKAGE extern "C"
38 #else
39 # define C_LINKAGE
40 #endif
42 #ifdef BUILDING_SUPERCOLLIDER // if SuperCollider is being built, instead of used
43 # define SC_DLLEXPORT_C C_LINKAGE SC_API_EXPORT
44 # define SC_DLLEXPORT SC_API_EXPORT
45 #else
46 # define SC_DLLEXPORT_C C_LINKAGE SC_API_IMPORT
47 # define SC_DLLEXPORT SC_API_IMPORT
48 #endif
50 #endif