Re: [FFmpeg-devel] compound literal in public header file

2018-05-17 Thread wm4
On Thu, 17 May 2018 00:41:10 +0200 Carl Eugen Hoyos wrote: > 2018-05-16 11:47 GMT+02:00, Steinar H. Gunderson > : > > On Wed, May 16, 2018 at 11:41:23AM +0200, Tobias Rapp wrote: > >> Yes, I am referring to usage of the libavutil headers in C. If the macro > >> is > >> only hidden for C++ and

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Carl Eugen Hoyos
2018-05-16 11:47 GMT+02:00, Steinar H. Gunderson : > On Wed, May 16, 2018 at 11:41:23AM +0200, Tobias Rapp wrote: >> Yes, I am referring to usage of the libavutil headers in C. If the macro >> is >> only hidden for C++ and available in C, that would be OK for me. But if >> the >> static inline func

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread wm4
On Wed, 16 May 2018 11:47:36 +0200 "Steinar H. Gunderson" wrote: > On Wed, May 16, 2018 at 11:41:23AM +0200, Tobias Rapp wrote: > > Yes, I am referring to usage of the libavutil headers in C. If the macro is > > only hidden for C++ and available in C, that would be OK for me. But if the > > stati

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread wm4
On Wed, 16 May 2018 17:58:46 +0800 Zhao Zhili wrote: > On 2018年05月16日 17:47, Steinar H. Gunderson wrote: > > On Wed, May 16, 2018 at 11:41:23AM +0200, Tobias Rapp wrote: > >> Yes, I am referring to usage of the libavutil headers in C. If the macro is > >> only hidden for C++ and available in C,

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Nicolas George
Tomas Härdin (2018-05-16): > However, it might > be nicer to make that a static inline function, if possible. Not possible, it has to be a macro. But macros do not cause compatibility problems. Regards, -- Nicolas George signature.asc Des

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Steinar H. Gunderson
On Wed, May 16, 2018 at 12:41:05PM +0200, Tomas Härdin wrote: > This comes up every now and then, and I know there was great opposition > to it previously from people who have since left the project. If you're > willing to be the person officially dealing with all "C++-isms" in the > headers then I

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Tomas Härdin
ons 2018-05-16 klockan 11:47 +0200 skrev Steinar H. Gunderson: > On Wed, May 16, 2018 at 11:41:23AM +0200, Tobias Rapp wrote: > > Yes, I am referring to usage of the libavutil headers in C. If the macro is > > only hidden for C++ and available in C, that would be OK for me. But if the > > static in

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Zhao Zhili
On 2018年05月16日 17:47, Steinar H. Gunderson wrote: On Wed, May 16, 2018 at 11:41:23AM +0200, Tobias Rapp wrote: Yes, I am referring to usage of the libavutil headers in C. If the macro is only hidden for C++ and available in C, that would be OK for me. But if the static inline function variant w

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Steinar H. Gunderson
On Wed, May 16, 2018 at 11:41:23AM +0200, Tobias Rapp wrote: > Yes, I am referring to usage of the libavutil headers in C. If the macro is > only hidden for C++ and available in C, that would be OK for me. But if the > static inline function variant would support both C and C++, this would look > l

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Tobias Rapp
On 16.05.2018 11:27, Tomas Härdin wrote: ons 2018-05-16 klockan 11:16 +0200 skrev Tobias Rapp: On 16.05.2018 10:29, Tomas Härdin wrote: ons 2018-05-16 klockan 10:18 +0800 skrev Zhao Zhili: The av_err2str macro in libavutil/error.h use compound literal: #define av_err2str(errnum) \   av_m

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Tomas Härdin
ons 2018-05-16 klockan 11:16 +0200 skrev Tobias Rapp: > On 16.05.2018 10:29, Tomas Härdin wrote: > > ons 2018-05-16 klockan 10:18 +0800 skrev Zhao Zhili: > > > The av_err2str macro in libavutil/error.h use compound literal: > > > > > > #define av_err2str(errnum) \ > > >   av_make_error_string(

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Tobias Rapp
On 16.05.2018 10:29, Tomas Härdin wrote: ons 2018-05-16 klockan 10:18 +0800 skrev Zhao Zhili: The av_err2str macro in libavutil/error.h use compound literal: #define av_err2str(errnum) \ av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum) C++ compi

Re: [FFmpeg-devel] compound literal in public header file

2018-05-16 Thread Tomas Härdin
ons 2018-05-16 klockan 10:18 +0800 skrev Zhao Zhili: > The av_err2str macro in libavutil/error.h use compound literal: > > #define av_err2str(errnum) \ > av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0},  > AV_ERROR_MAX_STRING_SIZE, errnum) > > C++ compiler may not support it or trea

[FFmpeg-devel] compound literal in public header file

2018-05-15 Thread Zhao Zhili
The av_err2str macro in libavutil/error.h use compound literal: #define av_err2str(errnum) \     av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum) C++ compiler may not support it or treat the usage as invalid. For example, g++ 5.4 raise an error: takin