diff options
author | Benny Baumann <BenBE@geshi.org> | 2021-06-27 12:44:01 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-07-06 17:20:32 +0200 |
commit | 44d1200ca47d1ffb5b20a9da183b1e0b25bfb8f7 (patch) | |
tree | a1b49791bb8b24454e440dc59e2102ff97c9f797 /configure.ac | |
parent | 3da142b4b6a1ab418d7cc564f42b0f5675293df3 (diff) |
Check for alloc_size attribute in configure.ac
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 8431242f..e9900e75 100644 --- a/configure.ac +++ b/configure.ac @@ -173,6 +173,20 @@ AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T +AC_MSG_CHECKING(for alloc_size) +old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wno-error -Werror=attributes" +AC_COMPILE_IFELSE([ + AC_LANG_SOURCE( + [ + __attribute__((alloc_size(1))) char* my_alloc(int size) { return 0; } + ],[] + )], + AC_DEFINE([HAVE_ATTR_ALLOC_SIZE], 1, [The alloc_size attribute is supported.]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) +CFLAGS="$old_CFLAGS" + # ---------------------------------------------------------------------- |