Version: 4.5 (using KDE 4.5.1) OS: Linux kmix didn't compiled on my system got error: In file included from /var/tmp/portage/kde-base/kmix-4.5.1/work/kmix-4.5.1/kmix/kmix-platforms.cpp:107, from /var/tmp/portage/kde-base/kmix-4.5.1/work/kmix-4.5.1/kmix/mixer.cpp:32: /var/tmp/portage/kde-base/kmix-4.5.1/work/kmix-4.5.1/kmix/mixer_oss4.cpp:68: warning: unused parameter ‘id’ /var/tmp/portage/kde-base/kmix-4.5.1/work/kmix-4.5.1/kmix/mixer_oss4.cpp:68: warning: unused parameter ‘on’ /var/tmp/portage/kde-base/kmix-4.5.1/work/kmix-4.5.1/kmix/mixer_oss4.cpp: In member function ‘MixDevice::ChannelType Mixer_OSS4::classifyAndRename(QString&, int)’: /var/tmp/portage/kde-base/kmix-4.5.1/work/kmix-4.5.1/kmix/mixer_oss4.cpp:80: error: ‘MIXF_MONVOL’ was not declared in this scope However I didn't installed OSS4. I think the problem is in kmix-platforms.cpp see below. Reproducible: Always Steps to Reproduce: Try to compile kmix with define SOUND_VERSION = 0x030000 in e.g. soundcard.h on linux. Actual Results: kmix didn't compiled. Expected Results: kmix should cmpile cleanly. The relevant code segment is in kmix/kmix-platforms.cpp: // OSS 3 / 4 ... #if !defined(__FreeBSD__) && SOUND_VERSION >= 0x040000 #define OSS4_MIXER #endif which is true if SOUND_VERSION is defined and not 0. Thus the compilation fail if no OSS4 is installed. This should be correct to #if !defined(__FreeBSD__) && (SOUND_VERSION >= 0x040000) #define OSS4_MIXER #endif and all ok.
Thanks for notifying. It must be some special compiler issue. Because I don't have the issue. I am compiling with the following and the mentioned #if does not return true: #define SOUND_VERSION 0x030802 Also there are a lot of standard headers that have checks without ( ), like: /usr/include/string.h:#if defined __GNUC__ && __GNUC__ >= 2 /usr/include/regex.h:# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) So I wonder what really triggers the issue. Your change look sensible, but I fear to break other platforms unless I have good faith of not doing harm. Do you have any explanation or can point to documentation about C preprocessor evaluation?
Additional info: http://gcc.gnu.org/onlinedocs/cpp/Defined.html#Defined also shows an example with "defined" and ">=": #if defined BUFSIZE && BUFSIZE >= 1024
There is no reply from the bug reporter yet. While I do not understand why the patch is necessary, the patch does not seem to do any harm, and I think it is safe to apply the patch.
SVN commit 1254098 by esken: BUGS: 253111 Resolve build trouble (OSSv4 vs OSSv3) M +1 -1 kmix-backends.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1254098
SVN commit 1254099 by esken: BUGS: 253111 Resolve build trouble (OSSv4 vs OSSv3) backport to trunk M +1 -1 kmix-backends.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1254099