Building kde-apps/krfb-16.04.0 with gcc-6 fails with:
>error: macro "max" passed 3 arguments, but takes just 2
"max" macro from libvncserver conflicts with the one from gcc
Created attachment 434232 [details, diff]
Based on upstream revision: https://github.com/rdieter/libvncserver/commit/53cc1fa18a3b96d2c31a145d971017564fca39bb
I ran into the same problem.
The patch fixed it right away!
Created attachment 451830 [details, diff]
The issue isn't with libvncserver, it's actually with krfb. There is already a fix in official upstream master to fix this. See the attached patch. The other patch is a work around by renaming the max macro. This new patch will use Standard Max if it exists rather than a custom one. :)
Sorry. Also noticed that the first attached patch in this report is from libvncserver master: https://github.com/LibVNC/libvncserver/commit/53cc1fa18a3b96d2c31a145d971017564fca39bb
Hmm. I need to test how this works with the the patch from krfb upstream. It'd be funny if they broke each other trying to fix each other's compile issues.
Created attachment 451860 [details]
I did some compile tests and the changing of the max function does work with the patch to krfb. :)
I made an updated ebuild to libvncserver to the latest master commit at the time of this post. This will include the patch from Peter Levine as that's in upstream already.
Changes in the ebuild:
- Switched to CMake
- Added systemd
- Added SDL and SDL2 (not sure if the latter works)
- Cleaned up the ebuild
- Couldn't find static lib compiling in the CMake files, so removed that.
- Added required use statements to clean up the configure section
Not a 100% certain this all works, so this ebuild requires more testing.
Created attachment 451862 [details, diff]
The patch needed for the attached ebuild to disable the automagic in the CMake files.
Created attachment 451894 [details]
Here is a version without a patch. I was shown a cool trick to stop automagic from happening when I don't want it. :)
Again. Needs testing with all the new features. I don't know how to test the systemd sockets.
(In reply to Jon from comment #7)
> Created attachment 451894 [details]
> Here is a version without a patch. I was shown a cool trick to stop
> automagic from happening when I don't want it. :)
> Again. Needs testing with all the new features. I don't know how to test the
> systemd sockets.
tbh I would rather see these automagic changes upstream if at all possible...
(In reply to Alex Xu (Hello71) from comment #8)
> (In reply to Jon from comment #7)
> > Created attachment 451894 [details]
> > libvncserver-0.9.10_p20160924.ebuild
> > Here is a version without a patch. I was shown a cool trick to stop
> > automagic from happening when I don't want it. :)
> > Again. Needs testing with all the new features. I don't know how to test the
> > systemd sockets.
> tbh I would rather see these automagic changes upstream if at all possible...
That would be nice, but this is upstream. I was thinking for wrapping the detection stuff with something like the patch I posted here and sending that upstream.
fixed in 0.9.11, stable in bug 605326. chose not to change to cmake for now.