Add FreeBSD compatibility
Hi, it's me, again :)
(Do not merge this just yet!)
So, it works on X11, can't test on DRM/KMS for now because kernel panic. (well, I could install a couple month old kernel where wlc/sway worked, but I'll look into fixing the problem instead)
-
-Wno-error=deprecated-declarations
becausewarning: 'wl_buffer' is deprecated
. This comes fromEGL/eglmesaext.h
. I have Mesa 17.2.2 and Wayland 1.13.0, but seems like it was deprecated a long long time ago. You didn't encounter this on Linux? o_0 - the libinput ifdefs are for compatibility with version 1.6.0 (damn we have to catch up…)
- There's the
environ
linking issue (undefined symbol). Maybe because of some linker flag that meson uses… - I'm not sure about the raw terminal thing (from https://github.com/Cloudef/wlc/commit/ef3c443b3ab97a3a900de386973a3d1a5ccb065c) — @johalun why did wlc both save/restore termios state and set the raw flag?
- The elephant in the room. The ugly part of the patch. The
_POSIX_C_SOURCE
/_XOPEN_SOURCE
stuff. What does it do on Linux? On FreeBSD, it actually makes all the headers compliant with old POSIX specifications and nothing more (__BSD_VISIBLE
gets disabled) — so we loseCLOCK_MONOTONIC
,minor
/major
,snprintf
and a bunch of other stuff I already forgot. Currently I haveifdef
'd these defines to Linux where they caused problems, but that's really bad. What do you think about them? Are they actually necessary anywhere at all?