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 apache#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 apache#65: expected a ";"
  __extension__ typedef int __guard __attribute__((mode(__DI__)));
                ^

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

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

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

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

Signed-off-by: guoshichao <[email protected]>
  • Loading branch information
extinguish authored and Jan Medek committed Sep 19, 2024
1 parent 3c68782 commit 31ee57e
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 31ee57e

Please sign in to comment.