Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD compile fixes #6

Merged
merged 12 commits into from Sep 4, 2019
Merged

FreeBSD compile fixes #6

merged 12 commits into from Sep 4, 2019

Conversation

stromnet
Copy link
Contributor

Minor fixes to build latest version on FreeBSD.
Also fix for non-init variable usage.

If config file(s) did not exist, cfg/var_cfg was not inited.
This caused segfault in destructor
In distributed .tar.gz, there is no Doxyfile.in, which CMake chokes on.
This works on 9.x aswell, not sure about Linux though so keeping in
ifdefs.

Note: To actually compile on FreeBSD 10.0 using clang, additional patch
is required. Not sure how do do that cleanly though, so keeping it in
FreeBSD port for now.. More specifically, in common/Event.h, ::tr1 needs
to be removed since FreeBSD 10/clang has this in c++11 base std:: now,
instead of std::tr1 sub-namespace.
@stromnet
Copy link
Contributor Author

A note on 10.0 compilation:

common/Event.h uses "std::tr1::shared_ptr". In FreeBSD 10, the clang compiler is used with some c++ 11 impl which does not provide this pre-11 syntax. Instead, it provides std::shared_ptr (since it is a real c++11 impl).

So, I guess it boils down to, telldus-core does not compile on, at least some, C++11 platforms. However, I'm not sure, at all, how to solve this in a portable way..
For now, it's handled with an extra patch in the (upcoming) FreeBSD port.

Ref: https://forums.freebsd.org/viewtopic.php?f=46&t=12553&p=258396#p258295

@mickeprag
Copy link
Contributor

We would like to merge this. Unfortunately commit 1f8f4b6 does not conform to our coding style guidlines.
The error is:
telldus-core/common/Thread.h:17: Found C system header after C++ system header. Should be: Thread.h, c system, c++ system, other.

10.1 does not have WCHAR_T_ENCODING, which results in empty strings from
TelldusCore::wideToString

Ref: http://developer.telldus.com/ticket/399
This is not recommended, but works. Without this fix, we get link error since clang uses extra header
rather than system header, and without link flags we fail.
@stromnet
Copy link
Contributor Author

Code style fixes has been added.
Also fixes from http://developer.telldus.com/ticket/399 has been added, allowing build on FreeBSD 10.1.

The previous one used $port erronously, it just happened to be right when I tested.
This patch works around a bug in uftdi/devd, which has been reported upstream.
@petterreinholdtsen
Copy link

Is there still something wrong with this pull request, after it was adjusted for coding style?

@telldus-bot telldus-bot merged commit cc77fd5 into telldus:master Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants