blob: 700b11033e3133ff8efab8cb57a73f2ed603b950 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
/*
Copyright (C) 2009 John Emmas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __msvc_rubberband_h__
#define __msvc_rubberband_h__
#ifdef RUBBERBAND_IS_IN_WIN_STATIC_LIB // #define if your project uses librubberband (under Windows) as a static library
#define RUBBERBAND_IS_IN_WINDLL 0
#endif
#if !defined(RUBBERBAND_IS_IN_WINDLL)
#if defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
// If you need '__declspec' compatibility, add extra compilers to the above as necessary
#define RUBBERBAND_IS_IN_WINDLL 1
#else
#define RUBBERBAND_IS_IN_WINDLL 0
#endif
#endif
#if RUBBERBAND_IS_IN_WINDLL && !defined(RUBBERBAND_API)
#if defined(BUILDING_RUBBERBAND)
#define RUBBERBAND_API __declspec(dllexport)
#define RUBBERBAND_APICALLTYPE __stdcall
#elif defined(COMPILER_MSVC) || defined(COMPILER_MINGW) // Probably needs Cygwin too, at some point
#define RUBBERBAND_API __declspec(dllimport)
#define RUBBERBAND_APICALLTYPE __stdcall
#else
#error "Attempting to define __declspec with an incompatible compiler !"
#endif
#elif !defined(RUBBERBAND_API)
// Other compilers / platforms could be accommodated here
#define RUBBERBAND_API
#define RUBBERBAND_APICALLTYPE
#define GETOPT_API
#define GETOPT_APICALLTYPE
#endif
#ifndef GETOPT_API
#if defined(BUILDING_GETOPT)
#define GETOPT_API __declspec(dllexport)
#define GETOPT_APICALLTYPE __cdecl
#elif defined(COMPILER_MSVC) || defined(COMPILER_MINGW) // Probably needs Cygwin too, at some point
#define GETOPT_API __declspec(dllimport)
#define GETOPT_APICALLTYPE __cdecl
#else
#error "Attempting to define __declspec with an incompatible compiler !"
#endif
#endif // GETOPT_API
#ifdef COMPILER_MSVC
#include <rpc.h>
#ifndef __THROW
#define __THROW throw()
#endif
namespace RubberBand {
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
// These are used to replicate 'dirent.h' functionality
// RUBBERBAND_API int RUBBERBAND_APICALLTYPE placeholder();
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
} // namespace Rubberband
#endif // COMPILER_MSVC
#endif // __msvc_rubberband_h__
|