[prev in list] [next in list] [prev in thread] [next in thread]
List: xvid-devel
Subject: Re: [Xvid-devel] Patch for XVID MPEG-4 DirectShow/MediaFoundation
From: Jerker_Bäck <jerker.back () gmail ! com>
Date: 2011-06-15 12:03:05
Message-ID: 4df89f7c.93330e0a.55f0.16d4 () mx ! google ! com
[Download RAW message or body]
Hi Edouard,
> My bad
OK, no problem
> ... xvid
> not going to work fine when forcing another calling convention during
> build. Sadly your patch doesn't address that :-)
I don't see that. To mark the exports as __cdecl would be consistent with
past and future builds of xvidcore. Even if someone took the trouble to
cream out some extra performance with a different calling convention, it
would present the same consistent interface to the outside world (__cdecl).
This is an improvement above the current implicit, unspoken fact that the
exports actually are __cdecl. We humans may be able to assume that, but the
compiler will be confused unless told exactly.
--------------------------------------------------------------
Here is another variant
#if defined(XVID_BUILD_DLL) && (defined(_WIN32) || defined(__CYGWIN__) || \
defined(_MSC_VER))
#define XVID_IMPEXP __declspec(dllexport)
#elif defined(XVID_BUILD_DLL) && (defined(__GNUC__) && (__GNUC__ >= 4))
#define XVID_IMPEXP __attribute__ ((visibility ("default")))
#else
#define XVID_IMPEXP extern
#endif
#if defined(_WIN32) || defined(_MSC_VER)
#define XVID_CALL __cdecl
#else
#define XVID_CALL
#endif
The GCC visibility is taken from:
http://gcc.gnu.org/wiki/Visibility
Note: I have no experience of how GCC visibility actually works (pitfalls or
special tweaks).
The apparently weird "|| defined(_MSC_VER)" is due to the fact that the MS
compiler may be used without the _WIN32 internal define (undefined for the
POSIX subsystem).
Regards
Jerker
_______________________________________________
Xvid-devel mailing list
Xvid-devel@xvid.org
http://list.xvid.org/mailman/listinfo/xvid-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic