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

Minor fixes to enable building with clang on OS X #56

Merged
merged 5 commits into from
May 6, 2015

Conversation

taion
Copy link

@taion taion commented May 4, 2015

There's 3 things going on here.

  1. Minor fixes where clang is less permissive than gcc regarding syntax.
  2. Some weirdness with TupleResult and TupleLastResult not properly compiling in clang, but with a workaround that I think is good enough.
  3. Working around a bunch of pain with the non-standard-compliant (I think) std::vector<bool> specialization in Apple's libc++ that's even worse than the normal std::vector<bool> specialization: https://llvm.org/bugs/show_bug.cgi?id=10314

Built and tested with Xcode 6.3.1 toolchain and gcc 4.9.2.

ETA: For #55 (adding this to get the link to the PR from the issue)

@taion
Copy link
Author

taion commented May 4, 2015

Revised commit only changed the commit comment to reference the issue.

@@ -5,7 +5,7 @@
http://www.boost.org/LICENSE_1_0.txt)
------------------------------------------------------------------------------*/

#include "endian.h"
#include "endian.hpp"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include "endian.hpp" should actually be removed entirely. It's endian.hpp that includes endian.ipp, and not the other way around.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my bad. Wasn't thinking.

@@ -20,6 +20,7 @@
#include "connector.hpp"
#include "error.hpp"
#include "rawsockdefs.hpp"
#include "./internal/udsopener.hpp"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the Pimpl idiom intended by

std::unique_ptr<Impl> impl_;

You didn't do the same in tcpconnector.hpp. Was there a clang error that made you do this? If so, what was the error?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I didn't notice the parallel with tcpconnector.hpp. It's due to some inconsistency in how clang handles nested classes for forward declarations. I'll have a better fix shortly.

@ecorm
Copy link
Owner

ecorm commented May 5, 2015

I checked everything except for the tuple stuff. I'm a bit too tired to parse that recursive madness, lol. I'll try going over the tuple stuff tomorrow evening.

Most of it looks fine, and I left comments where I had concerns / questions. Please respond when you get the chance. I see that you already addressed one of them.

We might need more test cases involving vector<bool>, but that can be part of a separate issue.

@taion taion force-pushed the jjia/clang-build branch 2 times, most recently from 0e47df3 to ab43b70 Compare May 5, 2015 22:20
@taion
Copy link
Author

taion commented May 5, 2015

Accidentally checked in the wrong code for the last commit a couple of times. This last version keeps the correct forwarding semantics on the constructor arguments, and correctly adds the test case to ensure that converting a nested tuple into a nested array still works.

// that for some reason: http://stackoverflow.com/q/24454664.
template <std::size_t N, typename... Ts>
using EnableIfTupleElement =
typename std::enable_if<N != sizeof...(Ts), int>::type;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually cleaner than what I had before. Kudos!

ecorm added a commit that referenced this pull request May 6, 2015
Minor fixes to enable building with clang on OS X
Fixes #56. Fixes #57.
@ecorm ecorm merged commit 210cf2b into ecorm:master May 6, 2015
@taion taion deleted the jjia/clang-build branch May 6, 2015 00:13
ecorm added a commit that referenced this pull request May 6, 2015
Minor fixes to enable building with clang on OS X
Fixes #55. Fixes #56.
@taion
Copy link
Author

taion commented May 6, 2015

Thanks!

@ecorm
Copy link
Owner

ecorm commented May 6, 2015

Good job, and thanks again for the contribution! 👍

Everything still work fine on my compiler/platform with no warnings. Units tests are ok.

Do you mind telling me which operating systems you tested this on, so that I can add a few more supported platforms to the project's README? You've already mentioned the compiler versions above.

@taion
Copy link
Author

taion commented May 6, 2015

OS X 10.10.3 (with clang)
Debian 8.0 "jessie" (with gcc)

I haven't actually built anything using the library yet. I only ran the tests, so I'm not positive everything works when actually using the library, but I plan to get to that in the next week or so.

@ecorm
Copy link
Owner

ecorm commented May 6, 2015

Thanks. The README says: "This library has been tested with: ...", so its not making any bold claims, hehe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants