mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 05:33:06 +00:00
Add support for the deprecated attribute
This is useful for enforcing the usage of getter/setter functions to access fields which are considered private or have unique access constraints.
This commit is contained in:
committed by
Qi Wang
parent
162ff8365d
commit
120abd703a
24
configure.ac
24
configure.ac
@@ -988,6 +988,30 @@ if test "x${je_cv_cold}" = "xyes" ; then
|
||||
AC_DEFINE([JEMALLOC_HAVE_ATTR_COLD], [ ], [ ])
|
||||
fi
|
||||
|
||||
dnl Check for deprecated attribute support.
|
||||
JE_CFLAGS_SAVE()
|
||||
JE_CFLAGS_ADD([-Wdeprecated-declarations])
|
||||
JE_COMPILABLE([deprecated attribute],
|
||||
[#if !__has_attribute(deprecated)
|
||||
#error "deprecated attribute not supported"
|
||||
#endif
|
||||
struct has_deprecated_field {
|
||||
int good;
|
||||
int __attribute__((deprecated("Do not use"))) bad;
|
||||
};
|
||||
],
|
||||
[struct has_deprecated_field instance;
|
||||
instance.good = 0;
|
||||
instance.bad = 1;
|
||||
],
|
||||
[je_cv_deprecated])
|
||||
JE_CFLAGS_RESTORE()
|
||||
if test "x${je_cv_deprecated}" = "xyes" ; then
|
||||
AC_DEFINE([JEMALLOC_HAVE_ATTR_DEPRECATED], [ ], [ ])
|
||||
JE_CFLAGS_ADD([-Wdeprecated-declarations])
|
||||
JE_CXXFLAGS_ADD([-Wdeprecated-declarations])
|
||||
fi
|
||||
|
||||
dnl Check for VM_MAKE_TAG for mmap support.
|
||||
JE_COMPILABLE([vm_make_tag],
|
||||
[#include <sys/mman.h>
|
||||
|
||||
Reference in New Issue
Block a user