mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 04:34:35 +03:00
Check for alloc_size attribute in configure.ac
This commit is contained in:
14
configure.ac
14
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"
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user