FFmpeg
capi.h
Go to the documentation of this file.
1 // Avisynth C Interface Version 0.20
2 // Copyright 2003 Kevin Atkinson
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, or visit
17 // http://www.gnu.org/copyleft/gpl.html .
18 //
19 // As a special exception, I give you permission to link to the
20 // Avisynth C interface with independent modules that communicate with
21 // the Avisynth C interface solely through the interfaces defined in
22 // avisynth_c.h, regardless of the license terms of these independent
23 // modules, and to copy and distribute the resulting combined work
24 // under terms of your choice, provided that every copy of the
25 // combined work is accompanied by a complete copy of the source code
26 // of the Avisynth C interface and Avisynth itself (with the version
27 // used to produce the combined work), being distributed under the
28 // terms of the GNU General Public License plus this exception. An
29 // independent module is a module which is not derived from or based
30 // on Avisynth C Interface, such as 3rd-party filters, import and
31 // export plugins, or graphical user interfaces.
32 
33 #ifndef AVS_CAPI_H
34 #define AVS_CAPI_H
35 
36 #ifdef __cplusplus
37 # define EXTERN_C extern "C"
38 #else
39 # define EXTERN_C
40 #endif
41 
42 #ifdef BUILDING_AVSCORE
43 # if defined(GCC) && defined(X86_32)
44 # define AVSC_CC
45 # else // MSVC builds and 64-bit GCC
46 # ifndef AVSC_USE_STDCALL
47 # define AVSC_CC __cdecl
48 # else
49 # define AVSC_CC __stdcall
50 # endif
51 # endif
52 #else // needed for programs that talk to AviSynth+
53 # ifndef AVSC_WIN32_GCC32 // see comment below
54 # ifndef AVSC_USE_STDCALL
55 # define AVSC_CC __cdecl
56 # else
57 # define AVSC_CC __stdcall
58 # endif
59 # else
60 # define AVSC_CC
61 # endif
62 #endif
63 
64 // On 64-bit Windows, there's only one calling convention,
65 // so there is no difference between MSVC and GCC. On 32-bit,
66 // this isn't true. The convention that GCC needs to use to
67 // even build AviSynth+ as 32-bit makes anything that uses
68 // it incompatible with 32-bit MSVC builds of AviSynth+.
69 // The AVSC_WIN32_GCC32 define is meant to provide a user
70 // switchable way to make builds of FFmpeg to test 32-bit
71 // GCC builds of AviSynth+ without having to screw around
72 // with alternate headers, while still default to the usual
73 // situation of using 32-bit MSVC builds of AviSynth+.
74 
75 // Hopefully, this situation will eventually be resolved
76 // and a broadly compatible solution will arise so the
77 // same 32-bit FFmpeg build can handle either MSVC or GCC
78 // builds of AviSynth+.
79 
80 #define AVSC_INLINE static __inline
81 
82 #ifdef BUILDING_AVSCORE
83 # define AVSC_EXPORT __declspec(dllexport)
84 # define AVSC_API(ret, name) EXTERN_C AVSC_EXPORT ret AVSC_CC name
85 #else
86 # define AVSC_EXPORT EXTERN_C __declspec(dllexport)
87 # ifndef AVSC_NO_DECLSPEC
88 # define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
89 # else
90 # define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
91 # endif
92 #endif
93 
94 #endif //AVS_CAPI_H