Summary: | x11-toolkits/mygui: stop redefining nullptr | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Dimitry Andric <dim> | ||||||||
Component: | Individual Port(s) | Assignee: | Dmitry Marakasov <amdmi3> | ||||||||
Status: | Closed FIXED | ||||||||||
Severity: | Affects Some People | CC: | amdmi3, tobik, val | ||||||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(amdmi3) |
||||||||
Version: | Latest | ||||||||||
Hardware: | Any | ||||||||||
OS: | Any | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 219139 | ||||||||||
Attachments: |
|
Description
Dimitry Andric
2017-06-21 17:14:31 UTC
I don't think that's correct fix since the client code will remain broken. I think it can be solved by adding a __cplusplus check instead. I'll set up clang50 jail and test. The problem is that the code is fundamentally broken, as the char type for basic_string *must* be a POD type. It's just that newer libc++ enforces this with a static assertion. I tried making this work in before-C++11 mode, but it is next to impossible. You'd have to remove the constructors and destructors, the assignment operator, and make the (only) private member public. (In reply to Dimitry Andric from comment #2) > The problem is that the code is fundamentally broken, as the char type for > basic_string *must* be a POD type. It's just that newer libc++ enforces > this with a static assertion. > > I tried making this work in before-C++11 mode, but it is next to impossible. > You'd have to remove the constructors and destructors, the assignment > operator, and make the (only) private member public. Scratch that, I was thinking about a completely different issue with another port. Sorry for the noise. :) Current master of mygui is much better, seems like they don't do that anymore, and they actually do use C++11 now. I've sent them a tiny patch https://github.com/MyGUI/mygui/pull/129 — only had to replace one occurrence of NULL instead of 0. Release OpenMW doesn't build with master mygui, but master OpenMW does. Can we do something about this? For OpenMW I'm currently working around it by using dim@'s patch and adding games/openmw/Makefile.local with CXXFLAGS+= -DMYGUI_DONT_REPLACE_NULLPTR (In reply to Tobias Kortkamp from comment #5) We can switch both mygui and openmw to git master :) https://github.com/myfreeweb/freebsd-ports-dank/commit/76b2e08afa11ca5c3368e1c5860baf9163523c80 ooh, OpenMW 0.43 came out. Yeah I think now we can just update mygui to git master Created attachment 188589 [details]
mygui.diff
Since defining MYGUI_DONT_REPLACE_NULLPTR fixes the problem and since I have
no idea what the right __cplusplus check to add would be: There is
only one place in the code where it's even used, how about just deleting
the section entirely. That way client code will not remain broken like
with the initial patch.
Created attachment 188596 [details]
mygui-git.patch
mygui git master requires no patches, just re-tested with OpenMW 0.43.0, works perfectly. Here's the simple patch for upgrading to git master.
Comment on attachment 188596 [details]
mygui-git.patch
I'm fine with either fix. Yours might be better. I'm hoping that Dmitry can make a choice here.
A commit references this bug: Author: amdmi3 Date: Tue Dec 19 20:18:24 UTC 2017 New revision: 456766 URL: https://svnweb.freebsd.org/changeset/ports/456766 Log: - Update to latest git, fixes c++11 problems PR: 220189 Changes: head/x11-toolkits/mygui/Makefile head/x11-toolkits/mygui/distinfo head/x11-toolkits/mygui/pkg-plist |