Skip to content

Commit

Permalink
Merged revision(s) 20133 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[Fix] mpt/osinfo/class.hpp: Avoid clashing with BSD macro on FreeBSD. Fixes <https://forum.openmpt.org/index.php?msg=50150>.
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.30@20135 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Feb 16, 2024
1 parent d7c6197 commit a88ce50
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions mptrack/MPTrackWine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ bool WineSetupIsSupported(mpt::OS::Wine::VersionContext & wineVersion)
if(wineVersion.RawBuildID().empty()) supported = false;
if(!TrackerSettings::Instance().WineSupportAllowUnknownHost)
{
if((wineVersion.HostClass() == mpt::osinfo::osclass::Linux) || ((wineVersion.HostClass() == mpt::osinfo::osclass::BSD) && wineVersion.RawHostSysName() == "FreeBSD"))
if((wineVersion.HostClass() == mpt::osinfo::osclass::Linux) || ((wineVersion.HostClass() == mpt::osinfo::osclass::BSD_) && wineVersion.RawHostSysName() == "FreeBSD"))
{
// ok
} else
Expand Down Expand Up @@ -425,7 +425,7 @@ void Initialize()

script += std::string() + "\n";

const std::string make = ((wineVersion.HostClass() == mpt::osinfo::osclass::BSD) ? "gmake" : "make");
const std::string make = ((wineVersion.HostClass() == mpt::osinfo::osclass::BSD_) ? "gmake" : "make");

std::vector<std::string> commands;
commands.push_back(make);
Expand Down Expand Up @@ -490,7 +490,7 @@ void Initialize()
winegcc.push_back("winegcc64-development");
}
winegcc.push_back("winegcc-development");
if(wineVersion.HostClass() != mpt::osinfo::osclass::BSD)
if(wineVersion.HostClass() != mpt::osinfo::osclass::BSD_)
{ // avoid C++ compiler on *BSD because libc++ Win32 support tends to be missing there.
if constexpr(mpt::arch_bits == 32)
{ // 32bit winegcc probably cannot compile to 64bit
Expand All @@ -511,7 +511,7 @@ void Initialize()
winegcc.push_back("winegcc64");
}
winegcc.push_back("winegcc");
if(wineVersion.HostClass() != mpt::osinfo::osclass::BSD)
if(wineVersion.HostClass() != mpt::osinfo::osclass::BSD_)
{ // avoid C++ compiler on *BSD because libc++ Win32 support tends to be missing there.
if constexpr(mpt::arch_bits == 32)
{ // 32bit winegcc probably cannot compile to 64bit
Expand Down Expand Up @@ -601,7 +601,7 @@ void Initialize()

script += std::string() + "{" + "\n";
script += std::string() + " echo 0" + "\n";
script += std::string() + " " + make + " -j " + mpt::afmt::dec(std::max(std::thread::hardware_concurrency(), static_cast<unsigned int>(1))) + " -f build/wine/wine_wrapper.mk" + " V=" + mpt::afmt::dec(makeverbosity) + " WINEGXX=$MPT_WINEGXX " + "MPT_WINEGCC_LANG=" + ((wineVersion.HostClass() == mpt::osinfo::osclass::BSD) ? "C" : "CPLUSPLUS") + " MPT_WINE_SEARCHPATH=" + wine.EscapePosixShell(nativeSearchPath) + " all MPT_PROGRESS_FILE=\"&4\" 4>&1 1>stdout.txt 2>stderr.txt" + "\n";
script += std::string() + " " + make + " -j " + mpt::afmt::dec(std::max(std::thread::hardware_concurrency(), static_cast<unsigned int>(1))) + " -f build/wine/wine_wrapper.mk" + " V=" + mpt::afmt::dec(makeverbosity) + " WINEGXX=$MPT_WINEGXX " + "MPT_WINEGCC_LANG=" + ((wineVersion.HostClass() == mpt::osinfo::osclass::BSD_) ? "C" : "CPLUSPLUS") + " MPT_WINE_SEARCHPATH=" + wine.EscapePosixShell(nativeSearchPath) + " all MPT_PROGRESS_FILE=\"&4\" 4>&1 1>stdout.txt 2>stderr.txt" + "\n";
script += std::string() + " echo -n $? > stdexit.txt" + "\n";
script += std::string() + " echo 100" + "\n";
script += std::string() + "} | " + dialog.Progress("[OK] Prepare OpenMPT Wine Integration\\n[OK] Compile native support\\n[>>] Compile Wine wrapper\\n\\n[3/3] Compiling Wine wrapper ...") + "\n";
Expand Down Expand Up @@ -634,7 +634,7 @@ void Initialize()
script += std::string() + " " + dialog.TextBox("stderr.txt") + "\n";
script += std::string() + "fi" + "\n";

script += std::string() + "" + make + " -j " + mpt::afmt::dec(std::max(std::thread::hardware_concurrency(), static_cast<unsigned int>(1))) + " -f build/wine/wine_wrapper.mk" + " V=" + mpt::afmt::dec(makeverbosity) + " WINEGXX=$MPT_WINEGXX " + "MPT_WINEGCC_LANG=" + ((wineVersion.HostClass() == mpt::osinfo::osclass::BSD) ? "C" : "CPLUSPLUS") + " MPT_WINE_SEARCHPATH=" + wine.EscapePosixShell(nativeSearchPath) + " all" + "\n";
script += std::string() + "" + make + " -j " + mpt::afmt::dec(std::max(std::thread::hardware_concurrency(), static_cast<unsigned int>(1))) + " -f build/wine/wine_wrapper.mk" + " V=" + mpt::afmt::dec(makeverbosity) + " WINEGXX=$MPT_WINEGXX " + "MPT_WINEGCC_LANG=" + ((wineVersion.HostClass() == mpt::osinfo::osclass::BSD_) ? "C" : "CPLUSPLUS") + " MPT_WINE_SEARCHPATH=" + wine.EscapePosixShell(nativeSearchPath) + " all" + "\n";
script += std::string() + "if [ \"$?\" -ne \"0\" ] ; then" + "\n";
if(TrackerSettings::Instance().WineSupportCompileVerbosity >= 1)
{
Expand Down
4 changes: 2 additions & 2 deletions src/mpt/osinfo/class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum class osclass {
Windows,
Linux,
Darwin,
BSD,
BSD_,
Haiku,
DOS,
};
Expand All @@ -47,7 +47,7 @@ inline mpt::osinfo::osclass get_class_from_sysname(const std::string & sysname)
} else if (sysname == "Darwin") {
result = mpt::osinfo::osclass::Darwin;
} else if (sysname == "FreeBSD" || sysname == "DragonFly" || sysname == "NetBSD" || sysname == "OpenBSD" || sysname == "MidnightBSD") {
result = mpt::osinfo::osclass::BSD;
result = mpt::osinfo::osclass::BSD_;
} else if (sysname == "Haiku") {
result = mpt::osinfo::osclass::Haiku;
} else if (sysname == "MS-DOS") {
Expand Down
2 changes: 1 addition & 1 deletion src/openmpt/sounddevice/SoundDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void Manager::ReEnumerate(bool firstRun)
#if defined(MPT_WITH_PORTAUDIO)
typeDefault[MPT_UFORMAT_MESSAGE("PortAudio-{}")(paJACK)].value = Info::DefaultFor::ProAudio;
#endif
} else if(GetSysInfo().SystemClass == mpt::osinfo::osclass::BSD)
} else if(GetSysInfo().SystemClass == mpt::osinfo::osclass::BSD_)
{
#if defined(MPT_WITH_PORTAUDIO)
typeDefault[MPT_UFORMAT_MESSAGE("PortAudio-{}")(paOSS)].value = Info::DefaultFor::System;
Expand Down
6 changes: 3 additions & 3 deletions src/openmpt/sounddevice/SoundDevicePortAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,12 +860,12 @@ std::vector<SoundDevice::Info> CPortaudioDevice::EnumerateDevices(ILogger &logge
result.apiName = MPT_USTRING("OSS");
result.default_ = ((Pa_GetHostApiInfo(Pa_GetDeviceInfo(dev)->hostApi)->defaultOutputDevice == static_cast<PaDeviceIndex>(dev)) ? Info::Default::Named : Info::Default::None);
result.flags = {
sysInfo.SystemClass == mpt::osinfo::osclass::BSD ? Info::Usability::Usable : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Usability::Deprecated : Info::Usability::NotAvailable,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD_ ? Info::Usability::Usable : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Usability::Deprecated : Info::Usability::NotAvailable,
Info::Level::Primary,
Info::Compatible::No,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD ? Info::Api::Native : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Api::Emulated : Info::Api::Emulated,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD_ ? Info::Api::Native : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Api::Emulated : Info::Api::Emulated,
Info::Io::FullDuplex,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD ? Info::Mixing::Hardware : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Mixing::Software : Info::Mixing::Software,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD_ ? Info::Mixing::Hardware : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Mixing::Software : Info::Mixing::Software,
Info::Implementor::External
};
break;
Expand Down
6 changes: 3 additions & 3 deletions src/openmpt/sounddevice/SoundDeviceRtAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,12 @@ std::vector<SoundDevice::Info> CRtAudioDevice::EnumerateDevices(ILogger &logger,
info.apiName = MPT_USTRING("OSS");
info.default_ = (rtinfo.isDefaultOutput ? Info::Default::Named : Info::Default::None);
info.flags = {
sysInfo.SystemClass == mpt::osinfo::osclass::BSD ? Info::Usability::Usable : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Usability::Deprecated : Info::Usability::NotAvailable,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD_ ? Info::Usability::Usable : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Usability::Deprecated : Info::Usability::NotAvailable,
Info::Level::Secondary,
Info::Compatible::No,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD ? Info::Api::Native : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Api::Emulated : Info::Api::Emulated,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD_ ? Info::Api::Native : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Api::Emulated : Info::Api::Emulated,
Info::Io::FullDuplex,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD ? Info::Mixing::Hardware : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Mixing::Software : Info::Mixing::Software,
sysInfo.SystemClass == mpt::osinfo::osclass::BSD_ ? Info::Mixing::Hardware : sysInfo.SystemClass == mpt::osinfo::osclass::Linux ? Info::Mixing::Software : Info::Mixing::Software,
Info::Implementor::External
};
break;
Expand Down

0 comments on commit a88ce50

Please sign in to comment.