Skip to content

Commit

Permalink
Fix attribute handling
Browse files Browse the repository at this point in the history
- Add a __has_attribute(x) pre-defined macro.
  Its value is 1 to minimize compile-time errors that might occur
  if an attribute is not supported.

- Remove __attribute__(x) macro definitions, as this is internally
  supported.
  • Loading branch information
dspinellis committed Jun 24, 2024
1 parent 88334bc commit 289fad1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion include/template/gcc-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#define __atomic_fetch_sub(x,y) (*(x)-=(y))
#define __atomic_fetch_sub_explicit(x,y,z) (*(x)-=(y))
#define __atomic_thread_fence(x)
#define __attribute__(x)
#define __auto_type auto
#define __builtin_add_overflow(x,y,z) ((x), (y), (z), 1)
#define __builtin_add_overflow_p(x,y,z) ((x), (y), 1)
Expand Down Expand Up @@ -154,6 +153,7 @@
#define __COUNTER__ 0
#define __extension
#pragma define_immutable __extension__
#define __has_attribute(x) 1
#define __int128 long
#define __int128_t long
#define __uint128_t long
Expand Down
1 change: 0 additions & 1 deletion src/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#endif

#define __extension__
#define __attribute__(x)
#define __const const
#define __builtin_va_list void *
#define __builtin_stdarg_start
Expand Down

0 comments on commit 289fad1

Please sign in to comment.