You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.5KB

  1. // Avisynth C Interface Version 0.20
  2. // Copyright 2003 Kevin Atkinson
  3. // This program is free software; you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation; either version 2 of the License, or
  6. // (at your option) any later version.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
  16. // http://www.gnu.org/copyleft/gpl.html .
  17. //
  18. // As a special exception, I give you permission to link to the
  19. // Avisynth C interface with independent modules that communicate with
  20. // the Avisynth C interface solely through the interfaces defined in
  21. // avisynth_c.h, regardless of the license terms of these independent
  22. // modules, and to copy and distribute the resulting combined work
  23. // under terms of your choice, provided that every copy of the
  24. // combined work is accompanied by a complete copy of the source code
  25. // of the Avisynth C interface and Avisynth itself (with the version
  26. // used to produce the combined work), being distributed under the
  27. // terms of the GNU General Public License plus this exception. An
  28. // independent module is a module which is not derived from or based
  29. // on Avisynth C Interface, such as 3rd-party filters, import and
  30. // export plugins, or graphical user interfaces.
  31. #ifndef AVS_CAPI_H
  32. #define AVS_CAPI_H
  33. #ifdef __cplusplus
  34. # define EXTERN_C extern "C"
  35. #else
  36. # define EXTERN_C
  37. #endif
  38. #ifdef BUILDING_AVSCORE
  39. # if defined(GCC) && defined(X86_32)
  40. # define AVSC_CC
  41. # else // MSVC builds and 64-bit GCC
  42. # ifndef AVSC_USE_STDCALL
  43. # define AVSC_CC __cdecl
  44. # else
  45. # define AVSC_CC __stdcall
  46. # endif
  47. # endif
  48. #else // needed for programs that talk to AviSynth+
  49. # ifndef AVSC_WIN32_GCC32 // see comment below
  50. # ifndef AVSC_USE_STDCALL
  51. # define AVSC_CC __cdecl
  52. # else
  53. # define AVSC_CC __stdcall
  54. # endif
  55. # else
  56. # define AVSC_CC
  57. # endif
  58. #endif
  59. // On 64-bit Windows, there's only one calling convention,
  60. // so there is no difference between MSVC and GCC. On 32-bit,
  61. // this isn't true. The convention that GCC needs to use to
  62. // even build AviSynth+ as 32-bit makes anything that uses
  63. // it incompatible with 32-bit MSVC builds of AviSynth+.
  64. // The AVSC_WIN32_GCC32 define is meant to provide a user
  65. // switchable way to make builds of FFmpeg to test 32-bit
  66. // GCC builds of AviSynth+ without having to screw around
  67. // with alternate headers, while still default to the usual
  68. // situation of using 32-bit MSVC builds of AviSynth+.
  69. // Hopefully, this situation will eventually be resolved
  70. // and a broadly compatible solution will arise so the
  71. // same 32-bit FFmpeg build can handle either MSVC or GCC
  72. // builds of AviSynth+.
  73. #define AVSC_INLINE static __inline
  74. #ifdef BUILDING_AVSCORE
  75. # define AVSC_EXPORT __declspec(dllexport)
  76. # define AVSC_API(ret, name) EXTERN_C AVSC_EXPORT ret AVSC_CC name
  77. #else
  78. # define AVSC_EXPORT EXTERN_C __declspec(dllexport)
  79. # ifndef AVSC_NO_DECLSPEC
  80. # define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
  81. # else
  82. # define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
  83. # endif
  84. #endif
  85. #endif //AVS_CAPI_H