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 changes to enable c++11 compilation #4024

Merged
merged 4 commits into from
Jul 3, 2014
Merged

Conversation

hvraven
Copy link
Contributor

@hvraven hvraven commented Jan 14, 2014

This adds several minor changes to allow compilation of xbmc with -std=c++11 (tested with clang-3.4).

Almost all changes are just syntax changes, which shouldn't change anything in the result. Only exception is commit 4feadca which changed the type of two macros from unsigned to signed, because it would lead to impossible narrowing

@hvraven
Copy link
Contributor Author

hvraven commented Jan 14, 2014

a thing I forgot: I didn't build xbmc with all features enabled, it may be that there are still places which need to be adjusted

@t-nelson
Copy link
Contributor

We're in feature freeze for Gotham now, so superfluous changes like this
are on hold. I might be interested in the last commit if you can find a
place where the old code was indeed misbehaving.

@hvraven
Copy link
Contributor Author

hvraven commented Jan 14, 2014

So I'll just leave it open for the next release after Gotham.
I think the last commit doesn't change anything in regards of the code, but c++11 is stricter about implicit narrowing. It's simply not possible to convert -3u into int, because it will result in a number too large for an int. C++03 doesn't care and will just perform bitwise comparison (which will be the same as (int)-3, for C++11 it's a compilation error. The fix should just force the behavior of C++03. I don't know much about the Window-code there. At a first look an enum seems to be the correct solution for that situation.

@t-nelson
Copy link
Contributor

Great. Thanks for understanding. We'll revisit this post Gotham.

@MartijnKaijser
Copy link
Member

@lorem-ipsum
care to rebase against current master?

@hvraven
Copy link
Contributor Author

hvraven commented Jun 11, 2014

Yup, give me a few days, I'm a bit busy right now

without a space after " compilation with -std=c++11 fails, because it
assumes the macro to be a string suffix, which it does not know / which is
invalid, because it doesn't start with a underscore
c++11 introduced a std::shared_ptr. With using namespace std and boost the
declaration without explicit namespace is invalid
@hvraven
Copy link
Contributor Author

hvraven commented Jul 2, 2014

A bit more than a few days, but now it should work again

hvraven and others added 2 commits July 3, 2014 09:47
c++11 supports explicit operator bool, which is used by newer boost if
c++11 is enabled, breaking the implicit conversions. A comparision to NULL
is used instead
@hvraven
Copy link
Contributor Author

hvraven commented Jul 3, 2014

Comparision against NULL is nicer than the explicit cast, I updated the branch and i merged your changes to ThreadMessage instead of my hacks.

@jmarshallnz
Copy link
Contributor

Thanks! jenkins build this please

jmarshallnz added a commit that referenced this pull request Jul 3, 2014
Minor changes to enable c++11 compilation
@jmarshallnz jmarshallnz merged commit e291748 into xbmc:master Jul 3, 2014
@MartijnKaijser MartijnKaijser modified the milestones: Helix 14.0-alpha1, Pending for inclusion Jul 19, 2014
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.

None yet

6 participants