Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
BletchMAME 1.0 has been released #115826 09/07/19 02:03 PM
Joined: Nov 1999
Posts: 655
B
Bletch Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Nov 1999
Posts: 655
Now that MAME 0.213 is out, it is time for BletchMAME to go 1.0:

http://bletchmame.s3-website-us-east-1.amazonaws.com/

Re: BletchMAME 1.0 has been released [Re: Bletch] #115901 09/11/19 11:24 PM
Joined: Mar 2001
Posts: 16,300
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,300
I'm trying to compile BletchMAME on the Mac. I've installed wxWidgets from Brew, and the first few files go well, but then...

Code
src/dialogs/inputs.cpp:146:75: warning: 'GetInputSeqRefs' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
                virtual std::vector<std::tuple<InputFieldRef, status::input_seq::type>> GetInputSeqRefs();
                                                                                        ^
src/dialogs/inputs.cpp:113:75: note: overridden virtual function is here
                virtual std::vector<std::tuple<InputFieldRef, status::input_seq::type>> GetInputSeqRefs() = 0;
                                                                                        ^
src/dialogs/inputs.cpp:165:75: warning: 'GetInputSeqRefs' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
                virtual std::vector<std::tuple<InputFieldRef, status::input_seq::type>> GetInputSeqRefs();
                                                                                        ^
src/dialogs/inputs.cpp:113:75: note: overridden virtual function is here
                virtual std::vector<std::tuple<InputFieldRef, status::input_seq::type>> GetInputSeqRefs() = 0;

/usr/bin/../include/c++/v1/__hash_table:868:5: error: 
      static_assert failed due to requirement 'integral_constant<bool, false>::value' "the specified hash does not meet the Hash requirements"
    static_assert(__check_hash_requirements<_Key, _Hash>::value,
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/bin/../include/c++/v1/__hash_table:883:1: note: 
      in instantiation of template class 'std::__1::__enforce_unordered_container_requirements<wxString, std::__1::hash<wxString>,
      std::__1::equal_to<wxString> >' requested here
typename __enforce_unordered_container_requirements<_Key, _Hash, _Equal>::type

/usr/bin/../include/c++/v1/unordered_map:856:26: note: 
      while substituting explicitly-specified template arguments into function template '__diagnose_unordered_container_requirements'
    static_assert(sizeof(__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), "");
                         ^
src/dialogs/inputs.cpp:214:43: note: in instantiation of template class 'std::__1::unordered_map<wxString, wxString, std::__1::hash<wxString>,
      std::__1::equal_to<wxString>, std::__1::allocator<std::__1::pair<const wxString, wxString> > >' requested here
                std::unordered_map<wxString, wxString>          m_codes;                                                         ^


There are a series of follow-on errors in inputs.cpp that seem to be caused by that.

I get worse errors on Linux actually, but we'll make Clang happy first and see if that helps there.

Re: BletchMAME 1.0 has been released [Re: Bletch] #115911 09/13/19 10:18 AM
Joined: Nov 1999
Posts: 655
B
Bletch Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Nov 1999
Posts: 655
While it is not an overall surprised that you're getting compilation errors with clang (I've been using GCC and MSVC, and running into warnings that in practice only happen with certain compilers is par the course), those particular problems seem odd, as I see "override" declarations there:

https://github.com/npwoods/bletchmame/blob/master/src/dialogs/inputs.cpp#L146
https://github.com/npwoods/bletchmame/blob/master/src/dialogs/inputs.cpp#L165

Re: BletchMAME 1.0 has been released [Re: Bletch] #115913 09/13/19 12:55 PM
Joined: Mar 2001
Posts: 16,300
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,300
I'm more concerned about the invalid hash error than the override warnings right now smile

Re: BletchMAME 1.0 has been released [Re: Bletch] #115914 09/13/19 01:31 PM
Joined: Jun 2001
Posts: 414
O
Olivier Galibert Offline
Senior Member
Offline
Senior Member
O
Joined: Jun 2001
Posts: 414
I don't see an override at line 162 on your link.

Re: BletchMAME 1.0 has been released [Re: Bletch] #115917 09/14/19 12:06 PM
Joined: Nov 1999
Posts: 655
B
Bletch Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Nov 1999
Posts: 655
Good call OG, I added a few overrides. I tried to make that particular warning fail the compilation, but that caused some problems with the wxWidgets headers.

I don't know what to make of the hash problem, other than the fact that I don't see that problem on Windows. wxString derives from std::basic_string, which I would (perhaps naively) expect to just work with std::hash.

Re: BletchMAME 1.0 has been released [Re: Bletch] #115918 09/14/19 01:22 PM
Joined: Mar 2001
Posts: 16,300
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,300
wxString doesn't derive from std::string on UTF-8 native systems (anything non-Windows, basically) so it's incompatible with std::hash.

Re: BletchMAME 1.0 has been released [Re: Bletch] #115920 09/15/19 01:24 PM
Joined: Nov 1999
Posts: 655
B
Bletch Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Nov 1999
Posts: 655
Ugh; I'm pretty dependent on wxString being usable in C++ data structures... what to do :-|

Re: BletchMAME 1.0 has been released [Re: Bletch] #115931 09/16/19 04:19 AM
Joined: Jun 2001
Posts: 414
O
Olivier Galibert Offline
Senior Member
Offline
Senior Member
O
Joined: Jun 2001
Posts: 414
Add a specialization of std::hash of wxString. That's reasonably simple. Here's what I used for QString:
Code
 namespace std {
 template<> struct hash<QString> {
     std::size_t operator()(const QString &s) const {
         return qHash(s);
     }
 };
 }

Re: BletchMAME 1.0 has been released [Re: Olivier Galibert] #115934 09/17/19 12:42 PM
Joined: Nov 1999
Posts: 655
B
Bletch Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Nov 1999
Posts: 655
Hmmm I think I know why I don't have this problem. There is a define wxUSE_STD_STRING that seems to be 1 for me, and probably not for you.

Particularly odd is this code from wx/string.h:
Code
// Don't do this if ToStdWstring() is not available. We could work around it
// but, presumably, if using std::wstring is undesirable, then so is using
// std::hash<> anyhow.
#if wxUSE_STD_STRING

#include <functional>

namespace std
{
    template<>
    struct hash<wxString>
    {
        size_t operator()(const wxString& s) const
        {
            return std::hash<std::wstring>()(s.ToStdWstring());
        }
    };
} // namespace std

#endif // wxUSE_STD_STRING

This looks like laziness on the part of the wxWidgets developers to me. Hash functions are easy to write.

In any case, I tried adding template specializations that only kick in when wxUSE_STD_STRING is off.

Page 1 of 2 1 2

Who's Online Now
1 registered members (Edstrom), 149 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,683
Posts114,012
Members4,863
Most Online510
Aug 26th, 2019
Powered by UBB.threads™ PHP Forum Software 7.7.3