GNOME Bugzilla – Bug 135116
gstflacenc.c fails to build in NetBSD
Last modified: 2004-12-22 21:47:04 UTC
The gstflacenc.c file fails to build under NetBSD, which aborts gst-plugins build. Here is the error: gstflacenc.c: In function `gst_flacenc_chain': gstflacenc.c:578: error: parse error before "void" gstflacenc.c:613: error: parse error before "void" gstflacenc.c:613: error: parse error before "void" gmake[3]: *** [libgstflac_la-gstflacenc.lo] Error 1 This is caused by the way NetBSD defines the NULL symbol and how gstreamer defines the GST_ELEMENT_ERROR macro; from /usr/include/sys/null.h: #define NULL (void *)0 One way to fix this is to patch gstflacenc.c to surround NULL with parenthesis, when using the GST_ELEMENT_ERROR macro. Another way is to fix the macro itself to always surround the value.
Created attachment 24652 [details] [review] Workaround for gstflacenc.c
Created attachment 24653 [details] [review] Real fix for gstelement.h (in gstreamer)
I've attached two patch files. One is just a workaround for the file in gst-plugins. The other is a more generic fix that can be applied to gstreamer, so that programs using the GST_ELEMENT_ERROR macro do not break. I really think that the generic fix should be applied, not the workaround.
I should check patches before sending, *SIGH*. Sorry!! It seems that the "real fix" doesn't work by the way the macro works. That is, the function could get two parenthesis around its arguments, and that makes the build fail. So go for the workaround, as that will put the parenthesis in the right place.
Yeah, the GST_ELEMENT_ERROR macros is quite confusing, because it takes 2 printf style strings in and we haven't come up with a good way to do that yet. The first patch is the correct one, I've applied it.