Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

OS X: use FSGetVolumeParms when targeting 10.5+.

PBHGetVolParmsSync() is not available when building with 64bit. The replacement
FSGetVolumeParms() is available on 10.5+ only. Use the latter when building
with target version 10.5+. This requires builds targeting 10.4 to 32bit and
allows building as 64bit when targeting 10.5+.

Change-Id: Ic53217f3090147bea473613335f9482623a470bd

+20 -4
+20 -4
rbutil/rbutilqt/base/utils.cpp
··· 160 160 161 161 if(result == noErr) { 162 162 GetVolParmsInfoBuffer volparms; 163 + /* PBHGetVolParmsSync() is not available for 64bit while 164 + FSGetVolumeParms() is available in 10.5+. Thus we need to use 165 + PBHGetVolParmsSync() for 10.4, and that also requires 10.4 to 166 + always use 32bit. 167 + Qt 4 supports 32bit on 10.6 Cocoa only. 168 + */ 169 + #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 170 + if(FSGetVolumeParms(volrefnum, &volparms, sizeof(volparms)) == noErr) 171 + #else 163 172 HParamBlockRec hpb; 164 173 hpb.ioParam.ioNamePtr = NULL; 165 174 hpb.ioParam.ioVRefNum = volrefnum; 166 175 hpb.ioParam.ioBuffer = (Ptr)&volparms; 167 176 hpb.ioParam.ioReqCount = sizeof(volparms); 168 - 169 - if(PBHGetVolParmsSync(&hpb) == noErr) { 177 + if(PBHGetVolParmsSync(&hpb) == noErr) 178 + #endif 179 + { 170 180 if(volparms.vMServerAdr == 0) { 171 181 if(bsd == (char*)volparms.vMDeviceID) { 172 182 name = QString::fromUtf16((const ushort*)volname.unicode, ··· 798 808 kFSVolInfoFSInfo, NULL, NULL, NULL); 799 809 if(result == noErr) { 800 810 GetVolParmsInfoBuffer volparms; 811 + /* See above -- PBHGetVolParmsSync() is not available for 64bit, 812 + * and FSGetVolumeParms() on 10.5+ only. */ 813 + #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 814 + if(FSGetVolumeParms(volrefnum, &volparms, sizeof(volparms)) == noErr) 815 + #else 801 816 HParamBlockRec hpb; 802 817 hpb.ioParam.ioNamePtr = NULL; 803 818 hpb.ioParam.ioVRefNum = volrefnum; 804 819 hpb.ioParam.ioBuffer = (Ptr)&volparms; 805 820 hpb.ioParam.ioReqCount = sizeof(volparms); 806 - 807 - if(PBHGetVolParmsSync(&hpb) == noErr) { 821 + if(PBHGetVolParmsSync(&hpb) == noErr) 822 + #endif 823 + { 808 824 if(volparms.vMServerAdr == 0) { 809 825 if(bsd == (char*)volparms.vMDeviceID) { 810 826 pid_t dissenter;