Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Compiling from source mosquitto v1.5 on FreeBSD bug #863
git clone --branch v1.5 https://github.com/eclipse/mosquitto
@denigmus - sorry the markdown parser turned my text into formatting. There should be two underscores on either side of FreeBSD.
@karlp - if you define _POSIX_C_SOURCE, you're supposed to write code which conforms to that version of the SUS. PF_UNSPEC is a non-standard BSDism and a conforming system will not define it if _POSIX_C_SOURCE is defined. That means using AF_UNSPEC, since that's what the standard defines, and while it's annoying that some systems don't define manifest constants which aren't in the standard while others do, what the standard says is that this is what is supposed to happen. Anyway, if you want to argue that mosquitto shouldn't compile on systems which don't define PF_UNSPEC in these circumstances, why not start with darwin, where _POSIX_C_SOURCE is deliberately not defined for exactly this reason in the #if part of the block cited above?
@ptjm if mosquitto is misusing posix source guards, then mosquitto should be fixed. But fixed to use posix source properly. Just saying that it's posix source for one OS, and non-posix source for another isn't fixing anything, it's just making a tangled mess. From what you're saying, clearly, mosquitto should be using AF_UNSPEC, rather than hacking on these include guards.