VirtualBox

Changeset 97964 in vbox for trunk/include


Ignore:
Timestamp:
Jan 3, 2023 9:40:54 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155055
Message:

iprt/assertcompile.h: The RTASSERTVAR variable must be 'C' external or gcc & clang could get annoyed when it's used both within RT_C_DECLS_BEGIN/END (in header) and outside.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/assertcompile.h

    r97963 r97964  
    103103 */
    104104#ifdef __GNUC__
    105 # define AssertCompileNS(expr)  extern int RTASSERTVAR[1] __attribute__((__unused__)), RTASSERTVAR[(expr) ? 1 : 0] __attribute__((__unused__))
     105# ifdef __cplusplus
     106#  define AssertCompileNS(expr)  extern "C" int RTASSERTVAR[1] __attribute__((__unused__)), RTASSERTVAR[(expr) ? 1 : 0] __attribute__((__unused__))
     107# else
     108#  define AssertCompileNS(expr)  extern int RTASSERTVAR[1] __attribute__((__unused__)), RTASSERTVAR[(expr) ? 1 : 0] __attribute__((__unused__))
     109# endif
    106110#elif defined(__IBMC__) || defined(__IBMCPP__)
    107111# define AssertCompileNS(expr)  extern int RTASSERTVAR[(expr) ? 1 : 0]
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