Changeset 37535 in vbox for trunk/include/iprt
- Timestamp:
- Jun 17, 2011 12:34:53 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72371
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cdefs.h
r37012 r37535 1306 1306 #define RT_BOOL(Value) ( !!(Value) ) 1307 1307 1308 /** @def RT_LODWORD 1309 * Gets the low dword (=uint32_t) of something. */ 1310 #define RT_LODWORD(a) ( (uint32_t)(a) ) 1311 1312 /** @def RT_HIDWORD 1313 * Gets the high dword (=uint32_t) of a 64-bit of something. */ 1314 #define RT_HIDWORD(a) ( (uint32_t)((a) >> 32) ) 1315 1316 /** @def RT_LOWORD 1317 * Gets the low word (=uint16_t) of something. */ 1318 #define RT_LOWORD(a) ( (a) & 0xffff ) 1319 1320 /** @def RT_HIWORD 1321 * Gets the high word (=uint16_t) of a 32-bit something. */ 1322 #define RT_HIWORD(a) ( (a) >> 16 ) 1323 1324 /** @def RT_LOBYTE 1325 * Gets the low byte of something. */ 1326 #define RT_LOBYTE(a) ( (a) & 0xff ) 1327 1328 /** @def RT_HIBYTE 1329 * Gets the low byte of a 16-bit something. */ 1330 #define RT_HIBYTE(a) ( (a) >> 8 ) 1308 /** @def RT_LO_U8 1309 * Gets the low uint8_t of a uint16_t or something equivalent. */ 1310 #ifdef __GNUC__ 1311 # define RT_LO_U8(a) __extension__ ({ AssertCompile(sizeof((a)) == sizeof(uint16_t)); (uint8_t)(a); }) 1312 #else 1313 # define RT_LO_U8(a) ( (uint8_t)(a) ) 1314 #endif 1315 /** @def RT_HI_U16 1316 * Gets the high uint16_t of a uint32_t or something equivalent). */ 1317 #ifdef __GNUC__ 1318 # define RT_HI_U8(a) __extension__ ({ AssertCompile(sizeof((a)) == sizeof(uint16_t)); (uint8_t)((a) >> 8); }) 1319 #else 1320 # define RT_HI_U8(a) ( (uint8_t)((a) >> 8) ) 1321 #endif 1322 1323 /** @def RT_LO_U16 1324 * Gets the low uint16_t of a uint32_t or something equivalent. */ 1325 #ifdef __GNUC__ 1326 # define RT_LO_U16(a) __extension__ ({ AssertCompile(sizeof((a)) == sizeof(uint64_t)); (uint32_t)(a); }) 1327 #else 1328 # define RT_LO_U16(a) ( (uint32_t)(a) ) 1329 #endif 1330 /** @def RT_HI_U16 1331 * Gets the high uint16_t of a uint32_t or something equivalent). */ 1332 #ifdef __GNUC__ 1333 # define RT_HI_U16(a) __extension__ ({ AssertCompile(sizeof((a)) == sizeof(uint32_t)); (uint16_t)((a) >> 16); }) 1334 #else 1335 # define RT_HI_U16(a) ( (uint16_t)((a) >> 16) ) 1336 #endif 1337 1338 /** @def RT_LO_U32 1339 * Gets the low uint32_t of a uint64_t or something equivalent. */ 1340 #ifdef __GNUC__ 1341 # define RT_LO_U32(a) __extension__ ({ AssertCompile(sizeof((a)) == sizeof(uint64_t)); (uint32_t)(a); }) 1342 #else 1343 # define RT_LO_U32(a) ( (uint32_t)(a) ) 1344 #endif 1345 /** @def RT_HI_U32 1346 * Gets the high uint32_t of a uint64_t or something equivalent). */ 1347 #ifdef __GNUC__ 1348 # define RT_HI_U32(a) __extension__ ({ AssertCompile(sizeof((a)) == sizeof(uint64_t)); (uint32_t)((a) >> 32); }) 1349 #else 1350 # define RT_HI_U32(a) ( (uint32_t)((a) >> 32) ) 1351 #endif 1331 1352 1332 1353 /** @def RT_BYTE1 1333 1354 * Gets the first byte of something. */ 1334 #define RT_BYTE1(a) ( (a) & 0xff ) 1335 1355 #define RT_BYTE1(a) ( (a) & 0xff ) 1336 1356 /** @def RT_BYTE2 1337 1357 * Gets the second byte of something. */ 1338 #define RT_BYTE2(a) ( ((a) >> 8) & 0xff ) 1339 1358 #define RT_BYTE2(a) ( ((a) >> 8) & 0xff ) 1340 1359 /** @def RT_BYTE3 1341 1360 * Gets the second byte of something. */ 1342 1361 #define RT_BYTE3(a) ( ((a) >> 16) & 0xff ) 1343 1344 1362 /** @def RT_BYTE4 1345 1363 * Gets the fourth byte of something. */ 1346 1364 #define RT_BYTE4(a) ( ((a) >> 24) & 0xff ) 1347 1348 1365 /** @def RT_BYTE5 1349 1366 * Gets the fifth byte of something. */ 1350 #define RT_BYTE5(a) (((a) >> 32) & 0xff) 1351 1367 #define RT_BYTE5(a) ( ((a) >> 32) & 0xff ) 1352 1368 /** @def RT_BYTE6 1353 1369 * Gets the sixth byte of something. */ 1354 #define RT_BYTE6(a) (((a) >> 40) & 0xff) 1355 1370 #define RT_BYTE6(a) ( ((a) >> 40) & 0xff ) 1356 1371 /** @def RT_BYTE7 1357 1372 * Gets the seventh byte of something. */ 1358 #define RT_BYTE7(a) (((a) >> 48) & 0xff) 1359 1373 #define RT_BYTE7(a) ( ((a) >> 48) & 0xff ) 1360 1374 /** @def RT_BYTE8 1361 1375 * Gets the eight byte of something. */ 1362 #define RT_BYTE8(a) (((a) >> 56) & 0xff) 1376 #define RT_BYTE8(a) ( ((a) >> 56) & 0xff ) 1377 1378 1379 /** @def RT_LODWORD 1380 * Gets the low dword (=uint32_t) of something. 1381 * @deprecated Use RT_LO_U32. */ 1382 #define RT_LODWORD(a) ( (uint32_t)(a) ) 1383 /** @def RT_HIDWORD 1384 * Gets the high dword (=uint32_t) of a 64-bit of something. 1385 * @deprecated Use RT_HI_U32. */ 1386 #define RT_HIDWORD(a) ( (uint32_t)((a) >> 32) ) 1387 1388 /** @def RT_LOWORD 1389 * Gets the low word (=uint16_t) of something. 1390 * @deprecated Use RT_LO_U16. */ 1391 #define RT_LOWORD(a) ( (a) & 0xffff ) 1392 /** @def RT_HIWORD 1393 * Gets the high word (=uint16_t) of a 32-bit something. 1394 * @deprecated Use RT_HI_U16. */ 1395 #define RT_HIWORD(a) ( (a) >> 16 ) 1396 1397 /** @def RT_LOBYTE 1398 * Gets the low byte of something. 1399 * @deprecated Use RT_LO_U8. */ 1400 #define RT_LOBYTE(a) ( (a) & 0xff ) 1401 /** @def RT_HIBYTE 1402 * Gets the low byte of a 16-bit something. 1403 * @deprecated Use RT_HI_U8. */ 1404 #define RT_HIBYTE(a) ( (a) >> 8 ) 1363 1405 1364 1406
Note:
See TracChangeset
for help on using the changeset viewer.