Skip to content

Commit

Permalink
greenhills: add empty "__extension__" definition to fix build error
Browse files Browse the repository at this point in the history
"libcxxmini/libxx_cxa_guard.cxx", line 47: error #77-D: this declaration has
          no storage class or type specifier
  __extension__ typedef int __guard __attribute__((mode(__DI__)));
  ^

"libcxxmini/libxx_cxa_guard.cxx", line 47: error #65: expected a ";"
  __extension__ typedef int __guard __attribute__((mode(__DI__)));
                ^

"libcxxmini/libxx_cxa_guard.cxx", line 64: error #20: identifier "__guard" is
          undefined
    int __cxa_guard_acquire(FAR __guard *g)
                                ^

"libcxxmini/libxx_cxa_guard.cxx", line 64: error #20: identifier "g" is
          undefined
    int __cxa_guard_acquire(FAR __guard *g)
                                         ^

"libcxxmini/libxx_cxa_guard.cxx", line 65: error #65: expected a ";"
    {
    ^

"libcxxmini/libxx_cxa_guard.cxx", line 93: warning #12-D: parsing restarts
          here after previous syntax error
  }

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
  • Loading branch information
extinguish authored and anchao committed Aug 19, 2024
1 parent b3627bb commit c95a9fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/nuttx/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,20 @@
# define CONFIG_HAVE_CXX14 1
#endif

/* Green Hills Software definitions *****************************************/

#if defined(__ghs__)

# define __extension__

#endif

/* GCC-specific definitions *************************************************/

#ifdef __GNUC__

/* Built-ins */
# if __GNUC__ >= 4
# if __GNUC__ >= 4 && !defined(__ghs__)
# define CONFIG_HAVE_BUILTIN_BSWAP16 1
# define CONFIG_HAVE_BUILTIN_BSWAP32 1
# define CONFIG_HAVE_BUILTIN_BSWAP64 1
Expand Down

0 comments on commit c95a9fc

Please sign in to comment.