VirtualBox

Changeset 85127 in vbox for trunk/include


Ignore:
Timestamp:
Jul 8, 2020 11:42:18 PM (5 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h: Made DECLHIDDEN imply nothrow and restrict its use to function (just like the newly added DECL_HIDDEN_NOTHROW). Added DECL_HIDDEN_ONLY and DECL_HIDDEN_THROW to accompany it. bugref:9794

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/sup.h

    r85121 r85127  
    11761176 * @param   envp            The environment vector.
    11771177 */
    1178 DECL_HIDDEN_NOTHROW(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int argc, char **argv, char **envp);
     1178DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int argc, char **argv, char **envp);
    11791179
    11801180/** @name SUPR3HardenedMain flags.
  • trunk/include/iprt/cdefs.h

    r85126 r85127  
    13541354#define DECL_IMPORT_NOTHROW(a_RetType)  DECL_NOTHROW(DECLIMPORT(a_RetType))
    13551355
     1356/** @def DECL_HIDDEN_ONLY
     1357 * How to declare a non-exported function or variable.
     1358 * @param   a_Type  The return type of the function or the data type of the variable.
     1359 * @sa      DECL_HIDDEN, DECL_HIDDEN_DATA, DECL_HIDDEN_CONST
     1360 * @internal Considered more or less internal.
     1361 */
     1362#if !defined(RT_GCC_SUPPORTS_VISIBILITY_HIDDEN) || defined(RT_NO_VISIBILITY_HIDDEN)
     1363# define DECL_HIDDEN_ONLY(a_Type)       a_Type
     1364#else
     1365# define DECL_HIDDEN_ONLY(a_Type)       __attribute__((visibility("hidden"))) a_Type
     1366#endif
     1367
    13561368/** @def DECLHIDDEN
    13571369 * How to declare a non-exported function or variable.
    13581370 * @param   a_Type  The return type of the function or the data type of the variable.
    1359  * @sa      DECL_HIDDEN_DATA, DECL_HIDDEN_CONST
     1371 * @sa      DECL_HIDDEN_THROW, DECL_HIDDEN_DATA, DECL_HIDDEN_CONST
    13601372 * @todo split up into data and non-data.
    13611373 */
    1362 #if !defined(RT_GCC_SUPPORTS_VISIBILITY_HIDDEN) || defined(RT_NO_VISIBILITY_HIDDEN)
    1363 # define DECLHIDDEN(a_Type)             a_Type
    1364 #else
    1365 # define DECLHIDDEN(a_Type)             __attribute__((visibility("hidden"))) a_Type
    1366 #endif
     1374#define DECLHIDDEN(a_Type)              DECL_NOTHROW(DECL_HIDDEN_ONLY(a_Type))
     1375
     1376/** @def DECL_HIDDEN_NOTHROW
     1377 * How to declare a non-exported function that does not throw C++ exceptions.
     1378 * @param   a_RetType   The return type of the function.
     1379 * @note    Same as DECLHIDDEN but provided to go along with DECL_IMPORT_NOTHROW
     1380 *          and DECL_EXPORT_NOTHROW.
     1381 */
     1382#define DECL_HIDDEN_NOTHROW(a_RetType)  DECL_NOTHROW(DECL_HIDDEN_ONLY(a_RetType))
     1383
     1384/** @def DECL_HIDDEN_THROW
     1385 * How to declare a non-exported function that may throw C++ exceptions.
     1386 * @param   a_RetType   The return type of the function.
     1387 */
     1388#define DECL_HIDDEN_THROW(a_RetType)    DECL_HIDDEN_ONLY(a_Type)
    13671389
    13681390/** @def DECL_HIDDEN_DATA
     
    13881410# define DECL_HIDDEN_CONST(a_Type)      DECL_HIDDEN_DATA(a_Type)
    13891411#endif
    1390 
    1391 /** @def DECL_HIDDEN_NOTHROW
    1392  * How to declare a non-exported function that does not throw C++ exceptions.
    1393  * @param   a_RetType   The return type of the function.
    1394  */
    1395 #define DECL_HIDDEN_NOTHROW(a_RetType)  DECL_NOTHROW(DECLHIDDEN(a_RetType))
    13961412
    13971413/** @def DECL_INVALID
     
    14881504 * @note    Use DECLCALLBACKTYPE for typedefs.
    14891505 */
    1490 #define DECLCALLBACK(a_Type)        DECL_NOTHROW(a_Type RT_FAR_CODE RTCALL)
     1506#define DECLCALLBACK(a_RetType)     DECL_NOTHROW(a_RetType RT_FAR_CODE RTCALL)
    14911507
    14921508/** @def DECL_HIDDEN_CALLBACK
     
    14961512 * @note    Use DECLCALLBACKTYPE for typedefs.
    14971513 */
    1498 #define DECL_HIDDEN_CALLBACK(a_Type) DECLHIDDEN(DECL_NOTHROW(a_Type RT_FAR_CODE RTCALL))
     1514#define DECL_HIDDEN_CALLBACK(a_RetType) DECL_HIDDEN_ONLY(DECLCALLBACK(a_RetType))
    14991515
    15001516/** @def DECLCALLBACKTYPE_EX
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette