mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
build: Assume __attribute__((cleanup)) always works
All recent compilers support this (except MS compilers which we don't care about). Assume it is supported. We test it in ./configure and hard fail if it doesn't work. We still define HAVE_ATTRIBUTE_CLEANUP but you can now assume it is always defined and don't have to check it.
This commit is contained in:
@@ -109,15 +109,12 @@ main (int argc, char *argv[])
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([HAVE_ATTRIBUTE_CLEANUP],[1],[Define to 1 if '__attribute__((cleanup(...)))' works with this compiler.])
|
||||
],[
|
||||
AC_MSG_WARN(
|
||||
AC_MSG_ERROR(
|
||||
['__attribute__((cleanup(...)))' does not work.
|
||||
|
||||
You may not be using a sufficiently recent version of GCC or CLANG, or
|
||||
you may be using a C compiler which does not support this attribute,
|
||||
or the configure test may be wrong.
|
||||
|
||||
The code will still compile, but is likely to leak memory and other
|
||||
resources when it runs.])])
|
||||
or the configure test may be wrong.])])
|
||||
dnl restore CFLAGS
|
||||
CFLAGS="${acx_nbdkit_save_CFLAGS}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user