Changeset 105873 in vbox for trunk/src/VBox
- Timestamp:
- Aug 27, 2024 2:52:54 PM (3 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/PlatformPropertiesImpl.cpp
r105872 r105873 45 45 46 46 47 // defines48 /////////////////////////////////////////////////////////////////////////////49 50 /** @def MY_VECTOR_ASSIGN_ARRAY51 * Safe way to copy an array (static + const) into a vector w/ minimal typing.52 *53 * @param a_rVector The destination vector reference.54 * @param a_aSrcArray The source array to assign to the vector.55 */56 #if RT_GNUC_PREREQ(13, 0) && !RT_GNUC_PREREQ(14, 0) && defined(VBOX_WITH_GCC_SANITIZER)57 /* Workaround for g++ 13.2 incorrectly failing on arrays with a single entry in ASAN builds.58 This is restricted to [13.0, 14.0), assuming the issue was introduced in the 13 cycle59 and will be fixed by the time 14 is done. If 14 doesn't fix it, extend the range60 version by version till it is fixed. */61 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \62 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wstringop-overread\""); \63 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \64 _Pragma("GCC diagnostic pop"); \65 } while (0)66 #else67 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \68 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \69 } while (0)70 #endif71 72 73 47 /* 74 48 * PlatformProperties implementation. … … 877 851 # endif 878 852 }; 879 MY_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures);853 RT_CPP_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures); 880 854 break; 881 855 } … … 889 863 GraphicsFeature_None 890 864 }; 891 MY_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures);865 RT_CPP_VECTOR_ASSIGN_ARRAY(vecSupportedGraphicsFeatures, s_aGraphicsFeatures); 892 866 break; 893 867 } -
trunk/src/VBox/Main/src-server/GraphicsAdapterImpl.cpp
r105865 r105873 37 37 38 38 #include <iprt/cpp/utils.h> 39 40 41 /** @def MY_VECTOR_ASSIGN_ARRAY42 * Safe way to copy an array (static + const) into a vector w/ minimal typing.43 *44 * @param a_rVector The destination vector reference.45 * @param a_aSrcArray The source array to assign to the vector.46 */47 #if RT_GNUC_PREREQ(13, 0) && !RT_GNUC_PREREQ(14, 0) && defined(VBOX_WITH_GCC_SANITIZER)48 /* Workaround for g++ 13.2 incorrectly failing on arrays with a single entry in ASAN builds.49 This is restricted to [13.0, 14.0), assuming the issue was introduced in the 13 cycle50 and will be fixed by the time 14 is done. If 14 doesn't fix it, extend the range51 version by version till it is fixed. */52 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \53 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wstringop-overread\""); \54 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \55 _Pragma("GCC diagnostic pop"); \56 } while (0)57 #else58 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \59 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \60 } while (0)61 #endif62 39 63 40 -
trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
r105864 r105873 56 56 #include <VBox/vd.h> 57 57 #include <VBox/vmm/cpum.h> 58 59 // defines60 /////////////////////////////////////////////////////////////////////////////61 62 /** @def MY_VECTOR_ASSIGN_ARRAY63 * Safe way to copy an array (static + const) into a vector w/ minimal typing.64 *65 * @param a_rVector The destination vector reference.66 * @param a_aSrcArray The source array to assign to the vector.67 */68 #if RT_GNUC_PREREQ(13, 0) && !RT_GNUC_PREREQ(14, 0) && defined(VBOX_WITH_GCC_SANITIZER)69 /* Workaround for g++ 13.2 incorrectly failing on arrays with a single entry in ASAN builds.70 This is restricted to [13.0, 14.0), assuming the issue was introduced in the 13 cycle71 and will be fixed by the time 14 is done. If 14 doesn't fix it, extend the range72 version by version till it is fixed. */73 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \74 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wstringop-overread\""); \75 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \76 _Pragma("GCC diagnostic pop"); \77 } while (0)78 #else79 # define MY_VECTOR_ASSIGN_ARRAY(a_rVector, a_aSrcArray) do { \80 (a_rVector).assign(&a_aSrcArray[0], &a_aSrcArray[RT_ELEMENTS(a_aSrcArray)]); \81 } while (0)82 #endif83 58 84 59 … … 1062 1037 #endif 1063 1038 }; 1064 MY_VECTOR_ASSIGN_ARRAY(aSupportedPlatformArchitectures, s_aPlatformArchitectures);1039 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedPlatformArchitectures, s_aPlatformArchitectures); 1065 1040 1066 1041 #ifdef VBOX_WITH_VIRT_ARMV8 … … 1086 1061 ClipboardMode_Bidirectional, 1087 1062 }; 1088 MY_VECTOR_ASSIGN_ARRAY(aSupportedClipboardModes, s_aClipboardModes);1063 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedClipboardModes, s_aClipboardModes); 1089 1064 return S_OK; 1090 1065 } … … 1099 1074 DnDMode_Bidirectional, 1100 1075 }; 1101 MY_VECTOR_ASSIGN_ARRAY(aSupportedDnDModes, s_aDnDModes);1076 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedDnDModes, s_aDnDModes); 1102 1077 return S_OK; 1103 1078 } … … 1118 1093 PointingHIDType_USBMultiTouchScreenPlusPad, 1119 1094 }; 1120 MY_VECTOR_ASSIGN_ARRAY(aSupportedPointingHIDTypes, s_aPointingHIDTypes);1095 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedPointingHIDTypes, s_aPointingHIDTypes); 1121 1096 return S_OK; 1122 1097 } … … 1132 1107 #endif 1133 1108 }; 1134 MY_VECTOR_ASSIGN_ARRAY(aSupportedKeyboardHIDTypes, s_aKeyboardHIDTypes);1109 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedKeyboardHIDTypes, s_aKeyboardHIDTypes); 1135 1110 return S_OK; 1136 1111 } … … 1147 1122 #endif 1148 1123 }; 1149 MY_VECTOR_ASSIGN_ARRAY(aSupportedVFSTypes, s_aVFSTypes);1124 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedVFSTypes, s_aVFSTypes); 1150 1125 return S_OK; 1151 1126 } … … 1159 1134 ImportOptions_ImportToVDI, 1160 1135 }; 1161 MY_VECTOR_ASSIGN_ARRAY(aSupportedImportOptions, s_aImportOptions);1136 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedImportOptions, s_aImportOptions); 1162 1137 return S_OK; 1163 1138 } … … 1172 1147 ExportOptions_StripAllNonNATMACs, 1173 1148 }; 1174 MY_VECTOR_ASSIGN_ARRAY(aSupportedExportOptions, s_aExportOptions);1149 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedExportOptions, s_aExportOptions); 1175 1150 return S_OK; 1176 1151 } … … 1187 1162 #endif 1188 1163 }; 1189 MY_VECTOR_ASSIGN_ARRAY(aSupportedGraphicsFeatures, s_aGraphicsFeatures);1164 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedGraphicsFeatures, s_aGraphicsFeatures); 1190 1165 1191 1166 return S_OK; … … 1202 1177 RecordingFeature_Video, 1203 1178 }; 1204 MY_VECTOR_ASSIGN_ARRAY(aSupportedRecordingFeatures, s_aRecordingFeatures);1179 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedRecordingFeatures, s_aRecordingFeatures); 1205 1180 #else /* !VBOX_WITH_RECORDING */ 1206 1181 aSupportedRecordingFeatures.clear(); … … 1221 1196 #endif 1222 1197 }; 1223 MY_VECTOR_ASSIGN_ARRAY(aSupportedRecordingAudioCodecs, s_aRecordingAudioCodecs);1198 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedRecordingAudioCodecs, s_aRecordingAudioCodecs); 1224 1199 return S_OK; 1225 1200 } … … 1238 1213 #endif 1239 1214 }; 1240 MY_VECTOR_ASSIGN_ARRAY(aSupportedRecordingVideoCodecs, s_aRecordingVideoCodecs);1215 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedRecordingVideoCodecs, s_aRecordingVideoCodecs); 1241 1216 return S_OK; 1242 1217 } … … 1253 1228 #endif 1254 1229 }; 1255 MY_VECTOR_ASSIGN_ARRAY(aSupportedRecordingVideoScalingModes, s_aRecordingVideoScalingModes);1230 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedRecordingVideoScalingModes, s_aRecordingVideoScalingModes); 1256 1231 return S_OK; 1257 1232 } … … 1267 1242 RecordingRateControlMode_VBR 1268 1243 }; 1269 MY_VECTOR_ASSIGN_ARRAY(aSupportedRecordingAudioRateControlModes, s_aRecordingAudioRateControlModes);1244 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedRecordingAudioRateControlModes, s_aRecordingAudioRateControlModes); 1270 1245 return S_OK; 1271 1246 } … … 1281 1256 RecordingRateControlMode_VBR 1282 1257 }; 1283 MY_VECTOR_ASSIGN_ARRAY(aSupportedRecordingVideoRateControlModes, s_aRecordingVideoRateControlModes);1258 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedRecordingVideoRateControlModes, s_aRecordingVideoRateControlModes); 1284 1259 return S_OK; 1285 1260 } … … 1295 1270 CloneOptions_KeepHwUUIDs, 1296 1271 }; 1297 MY_VECTOR_ASSIGN_ARRAY(aSupportedCloneOptions, s_aCloneOptions);1272 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedCloneOptions, s_aCloneOptions); 1298 1273 return S_OK; 1299 1274 } … … 1308 1283 AutostopType_AcpiShutdown, 1309 1284 }; 1310 MY_VECTOR_ASSIGN_ARRAY(aSupportedAutostopTypes, s_aAutostopTypes);1285 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedAutostopTypes, s_aAutostopTypes); 1311 1286 return S_OK; 1312 1287 } … … 1322 1297 VMProcPriority_High, 1323 1298 }; 1324 MY_VECTOR_ASSIGN_ARRAY(aSupportedVMProcPriorities, s_aVMProcPriorities);1299 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedVMProcPriorities, s_aVMProcPriorities); 1325 1300 return S_OK; 1326 1301 } … … 1344 1319 NetworkAttachmentType_Null, 1345 1320 }; 1346 MY_VECTOR_ASSIGN_ARRAY(aSupportedNetworkAttachmentTypes, s_aNetworkAttachmentTypes);1321 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedNetworkAttachmentTypes, s_aNetworkAttachmentTypes); 1347 1322 return S_OK; 1348 1323 } … … 1358 1333 PortMode_TCP, 1359 1334 }; 1360 MY_VECTOR_ASSIGN_ARRAY(aSupportedPortModes, s_aPortModes);1335 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedPortModes, s_aPortModes); 1361 1336 return S_OK; 1362 1337 } … … 1396 1371 AudioDriverType_Null, 1397 1372 }; 1398 MY_VECTOR_ASSIGN_ARRAY(aSupportedAudioDriverTypes, s_aAudioDriverTypes);1373 RT_CPP_VECTOR_ASSIGN_ARRAY(aSupportedAudioDriverTypes, s_aAudioDriverTypes); 1399 1374 return S_OK; 1400 1375 } … … 1424 1399 #endif 1425 1400 }; 1426 MY_VECTOR_ASSIGN_ARRAY(aExecutionEngines, s_aExecEngines);1401 RT_CPP_VECTOR_ASSIGN_ARRAY(aExecutionEngines, s_aExecEngines); 1427 1402 break; 1428 1403 } … … 1442 1417 # endif 1443 1418 }; 1444 MY_VECTOR_ASSIGN_ARRAY(aExecutionEngines, s_aExecEngines);1419 RT_CPP_VECTOR_ASSIGN_ARRAY(aExecutionEngines, s_aExecEngines); 1445 1420 #else 1446 1421 aExecutionEngines.clear();
Note:
See TracChangeset
for help on using the changeset viewer.