Incompatible with rtmidi 5.0.0
dvzrv opened this issue · 4 comments
Hi! I'm packaging rtmidi for Arch Linux and am currently attempting a rebuild of all depending packages (due to a soname change).
It appears, that rtmidi switched to C++11, which is incompatible with milkytracker, as it relies on C++98.
[55/216] Building CXX object src/midi/CMakeFiles/midi.dir/posix/MidiReceiver_pthread.cpp.o
FAILED: src/midi/CMakeFiles/midi.dir/posix/MidiReceiver_pthread.cpp.o
/usr/bin/c++ -DMILKYTRACKER -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi/../milkyplay -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi/../ppui -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi/../ppui/osinterface -I/build/milkytracker/src/
MilkyTracker-1.03.00/src/midi/../tracker -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi/../ppui/osinterface/posix -I/usr/include/rtmidi -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -std=c++98 -MD -MT src/midi/CMakeFiles/midi.dir/posix/MidiReceiver_pthread.cpp.o -MF src/midi/CMakeFiles/m
idi.dir/posix/MidiReceiver_pthread.cpp.o.d -o src/midi/CMakeFiles/midi.dir/posix/MidiReceiver_pthread.cpp.o -c /build/milkytracker/src/MilkyTracker-1.03.00/src/midi/posix/MidiReceiver_pthread.cpp
In file included from /build/milkytracker/src/MilkyTracker-1.03.00/src/midi/posix/MidiReceiver_pthread.cpp:34:
/usr/include/rtmidi/RtMidi.h:137:19: error: expected ‘,’ or ‘...’ before ‘&&’ token
137 | RtMidi(RtMidi&& other) noexcept;
| ^~
/usr/include/rtmidi/RtMidi.h:137:6: error: invalid constructor; you probably meant ‘RtMidi (const RtMidi&)’
137 | RtMidi(RtMidi&& other) noexcept;
| ^~~~~~
/usr/include/rtmidi/RtMidi.h:137:27: error: expected ‘;’ at end of member declaration
137 | RtMidi(RtMidi&& other) noexcept;
| ^
| ;
/usr/include/rtmidi/RtMidi.h:137:29: error: ‘noexcept’ does not name a type
137 | RtMidi(RtMidi&& other) noexcept;
| ^~~~~~~~
/usr/include/rtmidi/RtMidi.h:137:29: note: C++11 ‘noexcept’ only available with ‘-std=c++11’ or ‘-std=gnu++11’
/usr/include/rtmidi/RtMidi.h:222:27: warning: defaulted and deleted functions only available with ‘-std=c++11’ or ‘-std=gnu++11’
222 | RtMidi(RtMidi& other) = delete;
| ^~~~~~
/usr/include/rtmidi/RtMidi.h:223:38: warning: defaulted and deleted functions only available with ‘-std=c++11’ or ‘-std=gnu++11’
223 | RtMidi& operator=(RtMidi& other) = delete;
| ^~~~~~
/usr/include/rtmidi/RtMidi.h:284:20: error: expected ‘,’ or ‘...’ before ‘&&’ token
284 | RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
| ^~
/usr/include/rtmidi/RtMidi.h:284:3: error: invalid constructor; you probably meant ‘RtMidiIn (const RtMidiIn&)’
284 | RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
| ^~~~~~~~
/usr/include/rtmidi/RtMidi.h:284:28: error: expected ‘;’ at end of member declaration
284 | RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
| ^
| ;
/usr/include/rtmidi/RtMidi.h:284:30: error: ‘noexcept’ does not name a type
284 | RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
| ^~~~~~~~
/usr/include/rtmidi/RtMidi.h:284:30: note: C++11 ‘noexcept’ only available with ‘-std=c++11’ or ‘-std=gnu++11’
In file included from /build/milkytracker/src/MilkyTracker-1.03.00/src/midi/posix/MidiReceiver_pthread.cpp:34:
/usr/include/rtmidi/RtMidi.h:428:22: error: expected ‘,’ or ‘...’ before ‘&&’ token
428 | RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
| ^~
/usr/include/rtmidi/RtMidi.h:428:3: error: invalid constructor; you probably meant ‘RtMidiOut (const RtMidiOut&)’
428 | RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
| ^~~~~~~~~
/usr/include/rtmidi/RtMidi.h:428:30: error: expected ‘;’ at end of member declaration
428 | RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
| ^
| ;
/usr/include/rtmidi/RtMidi.h:428:32: error: ‘noexcept’ does not name a type
428 | RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
| ^~~~~~~~
/usr/include/rtmidi/RtMidi.h:428:32: note: C++11 ‘noexcept’ only available with ‘-std=c++11’ or ‘-std=gnu++11’
Are there any plans to update this project's C++ standard? :)
the obvious "fix" (that i'm employing for the Debian package) is to simply set the CMAKE_CXX_STANDARD to 11
in
Lines 25 to 26 in 3533e5d
afaict, setting this value to 98
is an attempt to keep the codebase of milkytracker itself clean of newer C++ constructs (probably to allow compilation on older compilers) but there's nothing really enforcing the old standard in the codebase.
@umlaeute yes, that's also what I ended up doing.
From an outsider's perspective it would be great to be able to solve this upstream of course.
While there might be a way to keep using C++98, after doing some investigating, I'm thinking it'd probably be okay to bump the Milkytracker C++ standard up to C++11 officially:
Primary versions should be fine:
- Linux/BSD/Windows/Mac builds should all be fine since they should all have access to more recent versions of gcc/g++
- The Amiga version fork looks like it probably has access to a gcc/g++ with c++11 support 1234, and the change could be omitted in the fork if it doesn't
Other versions:
- Android ports should probably be fine incorporating this, although I can't find any Android forks that are up to date, so that might not matter
- Haiku - should probably work on at least some versions, there's already a port of Milkytracker 1.03 available so SDL2 should be fine, and gcc versions supporting c++11 appear to work on (at least some) versions of Haiku
- Windows CE - It looks like wince already had compatibility broken when Milkytracker sdl1 support was dropped, since I don't think it supports sdl2 wince/pocket pc (https://wiki.libsdl.org/FAQWindows#can_i_build_sdl_for_windows_ce), and there don't seem to be any recent builds for wince, unless I'm missing a fork somewhere.