diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-02-07 03:42:33 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2024-02-07 03:42:33 +0100 |
commit | 8ef20de5e905dbd41bf9b37ae6b9d5bdaf4bbd58 (patch) | |
tree | 4a15d6bacb87700898b3742eb9550d2598d74793 | |
parent | 273fe645f9646e84c06505d418d74ba0c559f10c (diff) | |
download | liba2i-8ef20de5e905dbd41bf9b37ae6b9d5bdaf4bbd58.tar.gz |
include/a2i/: Use old GNU attribute syntax
This allows supporting older compilers.
Cc: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | include/a2i/a2i.h | 8 | ||||
-rw-r--r-- | include/a2i/inline.h | 2 | ||||
-rw-r--r-- | include/a2i/str2i.h | 6 | ||||
-rw-r--r-- | include/a2i/strtoi.h | 24 |
4 files changed, 20 insertions, 20 deletions
diff --git a/include/a2i/a2i.h b/include/a2i/a2i.h index 21e20f1..f380d30 100644 --- a/include/a2i/a2i.h +++ b/include/a2i/a2i.h @@ -80,10 +80,10 @@ #define A2I_A2I_PROTOTYPE(name, TYPE) \ - [[gnu::access(write_only, 1)]] \ - [[gnu::access(read_only, 2)]] \ - [[gnu::access(write_only, 3)]] \ - [[gnu::null_terminated_string_arg(2)]] \ + __attribute__((__access__(write_only, 1))) \ + __attribute__((__access__(read_only, 2))) \ + __attribute__((__access__(write_only, 3))) \ + __attribute__((__null_terminated_string_arg__(2))) \ a2i_inline int name(TYPE *restrict n, const char *s, \ char **a2i_nullable restrict endp, int base, TYPE min, TYPE max) diff --git a/include/a2i/inline.h b/include/a2i/inline.h index f202d22..6e61e17 100644 --- a/include/a2i/inline.h +++ b/include/a2i/inline.h @@ -10,7 +10,7 @@ #if (A2I_FTM_INLINE == 0) -# define a2i_inline [[gnu::noipa]] inline +# define a2i_inline __attribute__((__noipa__)) inline #elif (A2I_FTM_INLINE == 1) # define a2i_inline inline #elif (A2I_FTM_INLINE == 2) diff --git a/include/a2i/str2i.h b/include/a2i/str2i.h index fa78de5..78a4a91 100644 --- a/include/a2i/str2i.h +++ b/include/a2i/str2i.h @@ -53,9 +53,9 @@ #define A2I_STR2I_PROTOTYPE(name, TYPE) \ - [[gnu::access(write_only, 1)]] \ - [[gnu::access(read_only, 2)]] \ - [[gnu::null_terminated_string_arg(2)]] \ + __attribute__((__access__(write_only, 1))) \ + __attribute__((__access__(read_only, 2))) \ + __attribute__((__null_terminated_string_arg__(2))) \ a2i_inline int name(TYPE *restrict n, const char *s) diff --git a/include/a2i/strtoi.h b/include/a2i/strtoi.h index ca2f12b..ef3ab34 100644 --- a/include/a2i/strtoi.h +++ b/include/a2i/strtoi.h @@ -68,24 +68,24 @@ #pragma clang assume_nonnull begin -[[gnu::access(read_only, 1)]] -[[gnu::access(write_only, 2)]] -[[gnu::access(write_only, 6)]] -[[gnu::null_terminated_string_arg(1)]] +__attribute__((__access__(read_only, 1))) +__attribute__((__access__(write_only, 2))) +__attribute__((__access__(write_only, 6))) +__attribute__((__null_terminated_string_arg__(1))) a2i_inline intmax_t a2i_strtoi(const char *s, char **a2i_nullable restrict endp, int base, intmax_t min, intmax_t max, int *a2i_nullable restrict status); -[[gnu::access(read_only, 1)]] -[[gnu::access(write_only, 2)]] -[[gnu::access(write_only, 6)]] -[[gnu::null_terminated_string_arg(1)]] +__attribute__((__access__(read_only, 1))) +__attribute__((__access__(write_only, 2))) +__attribute__((__access__(write_only, 6))) +__attribute__((__null_terminated_string_arg__(1))) a2i_inline uintmax_t a2i_strtou(const char *s, char **a2i_nullable restrict endp, int base, uintmax_t min, uintmax_t max, int *a2i_nullable restrict status); -[[gnu::access(read_only, 1)]] -[[gnu::access(write_only, 2)]] -[[gnu::access(write_only, 6)]] -[[gnu::null_terminated_string_arg(1)]] +__attribute__((__access__(read_only, 1))) +__attribute__((__access__(write_only, 2))) +__attribute__((__access__(write_only, 6))) +__attribute__((__null_terminated_string_arg__(1))) a2i_inline uintmax_t a2i_strtou_noneg(const char *s, char **a2i_nullable restrict endp, int base, uintmax_t min, uintmax_t max, int *a2i_nullable restrict status); |