Commit 18bbb2dd authored by Stephen Hutchinson's avatar Stephen Hutchinson Committed by Gyan Doshi

compat/avisynth: update headers

As part of the update, it is now possible to test 32-bit GCC builds
of AviSynth+ with FFmpeg by using the AVS_WIN32_GCC32 define. Due to
different calling conventions between MSVC and GCC regarding 32-bit
Windows, this is unfortunately necessary.
parent 16154c01
This diff is collapsed.
......@@ -39,17 +39,49 @@
# define EXTERN_C
#endif
#ifndef AVSC_USE_STDCALL
# define AVSC_CC __cdecl
#else
# define AVSC_CC __stdcall
#ifdef BUILDING_AVSCORE
# if defined(GCC) && defined(X86_32)
# define AVSC_CC
# else // MSVC builds and 64-bit GCC
# ifndef AVSC_USE_STDCALL
# define AVSC_CC __cdecl
# else
# define AVSC_CC __stdcall
# endif
# endif
#else // needed for programs that talk to AviSynth+
# ifndef AVSC_WIN32_GCC32 // see comment below
# ifndef AVSC_USE_STDCALL
# define AVSC_CC __cdecl
# else
# define AVSC_CC __stdcall
# endif
# else
# define AVSC_CC
# endif
#endif
// On 64-bit Windows, there's only one calling convention,
// so there is no difference between MSVC and GCC. On 32-bit,
// this isn't true. The convention that GCC needs to use to
// even build AviSynth+ as 32-bit makes anything that uses
// it incompatible with 32-bit MSVC builds of AviSynth+.
// The AVSC_WIN32_GCC32 define is meant to provide a user
// switchable way to make builds of FFmpeg to test 32-bit
// GCC builds of AviSynth+ without having to screw around
// with alternate headers, while still default to the usual
// situation of using 32-bit MSVC builds of AviSynth+.
// Hopefully, this situation will eventually be resolved
// and a broadly compatible solution will arise so the
// same 32-bit FFmpeg build can handle either MSVC or GCC
// builds of AviSynth+.
#define AVSC_INLINE static __inline
#ifdef BUILDING_AVSCORE
# define AVSC_EXPORT EXTERN_C
# define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name
# define AVSC_EXPORT __declspec(dllexport)
# define AVSC_API(ret, name) EXTERN_C AVSC_EXPORT ret AVSC_CC name
#else
# define AVSC_EXPORT EXTERN_C __declspec(dllexport)
# ifndef AVSC_NO_DECLSPEC
......
......@@ -42,7 +42,7 @@
// alignment. They should always request the exact alignment value they need.
// This is to make sure that plugins work over the widest range of AviSynth
// builds possible.
#define FRAME_ALIGN 32
#define FRAME_ALIGN 64
#if defined(_M_AMD64) || defined(__x86_64)
# define X86_64
......@@ -52,4 +52,19 @@
# error Unsupported CPU architecture.
#endif
#if defined(_MSC_VER)
# define MSVC
#elif defined(__GNUC__)
# define GCC
#elif defined(__clang__)
# define CLANG
#else
# error Unsupported compiler.
#endif
#if defined(GCC)
# undef __forceinline
# define __forceinline inline
#endif
#endif //AVS_CONFIG_H
......@@ -35,6 +35,12 @@
// Define all types necessary for interfacing with avisynth.dll
#ifdef __cplusplus
#include <cstddef>
#else
#include <stddef.h>
#endif
// Raster types used by VirtualDub & Avisynth
typedef unsigned int Pixel32;
typedef unsigned char BYTE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment