mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
c64d40bad7
This didn't have a header and this was implied LGPL, but this was not entirely correct. It turns out the printf attribute code was leaked in from talloc, which is "LGPL v3 or later". talloc was added to the mplayer2 code base in27a30e310e
. This remaining code was an oversight. Since we want to reduce LGPL v3 code, replace this code with the one from ta/ta.h. This code was explicitly written newly to get rid of talloc and its license in0933f12d28
.
22 lines
522 B
C
22 lines
522 B
C
#ifndef MPV_COMPILER_H
|
|
#define MPV_COMPILER_H
|
|
|
|
#define MP_EXPAND_ARGS(...) __VA_ARGS__
|
|
|
|
#ifdef __GNUC__
|
|
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2)))
|
|
#define MP_NORETURN __attribute__((noreturn))
|
|
#else
|
|
#define PRINTF_ATTRIBUTE(a1, a2)
|
|
#define MP_NORETURN
|
|
#endif
|
|
|
|
// Broken crap with __USE_MINGW_ANSI_STDIO
|
|
#if defined(__MINGW32__) && defined(__GNUC__) && !defined(__clang__)
|
|
#undef PRINTF_ATTRIBUTE
|
|
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (gnu_printf, a1, a2)))
|
|
#endif
|
|
|
|
|
|
#endif
|