2 Copyright (C) 2009 John Emmas
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.
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.
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.
19 #ifndef __msvc_rubberband_h__
20 #define __msvc_rubberband_h__
22 #ifdef RUBBERBAND_IS_IN_WIN_STATIC_LIB // #define if your project uses librubberband (under Windows) as a static library
23 #define RUBBERBAND_IS_IN_WINDLL 0
26 #if !defined(RUBBERBAND_IS_IN_WINDLL)
27 #if defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
28 // If you need '__declspec' compatibility, add extra compilers to the above as necessary
29 #define RUBBERBAND_IS_IN_WINDLL 1
31 #define RUBBERBAND_IS_IN_WINDLL 0
35 #if RUBBERBAND_IS_IN_WINDLL && !defined(RUBBERBAND_API)
36 #if defined(BUILDING_RUBBERBAND)
37 #define RUBBERBAND_API __declspec(dllexport)
38 #define RUBBERBAND_APICALLTYPE __stdcall
39 #elif defined(COMPILER_MSVC) || defined(COMPILER_MINGW) // Probably needs Cygwin too, at some point
40 #define RUBBERBAND_API __declspec(dllimport)
41 #define RUBBERBAND_APICALLTYPE __stdcall
43 #error "Attempting to define __declspec with an incompatible compiler !"
45 #elif !defined(RUBBERBAND_API)
46 // Other compilers / platforms could be accommodated here
47 #define RUBBERBAND_API
48 #define RUBBERBAND_APICALLTYPE
50 #define GETOPT_APICALLTYPE
54 #if defined(BUILDING_GETOPT)
55 #define GETOPT_API __declspec(dllexport)
56 #define GETOPT_APICALLTYPE __cdecl
57 #elif defined(COMPILER_MSVC) || defined(COMPILER_MINGW) // Probably needs Cygwin too, at some point
58 #define GETOPT_API __declspec(dllimport)
59 #define GETOPT_APICALLTYPE __cdecl
61 #error "Attempting to define __declspec with an incompatible compiler !"
69 #define __THROW throw()
72 namespace RubberBand {
76 #endif /* __cplusplus */
78 // These are used to replicate 'dirent.h' functionality
79 // RUBBERBAND_API int RUBBERBAND_APICALLTYPE placeholder();
83 #endif /* __cplusplus */
85 } // namespace Rubberband
87 #endif // COMPILER_MSVC
88 #endif // __msvc_rubberband_h__