1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 03:55:04 +03:00

build: Move definition of ATTRIBUTE_DESTRUCTOR to libxml.h

This commit is contained in:
Nick Wellnhofer 2024-06-25 22:06:36 +02:00
parent fd099dd8dc
commit 1afaa37128
5 changed files with 4 additions and 8 deletions

View File

@ -139,9 +139,6 @@ if (NOT MSVC)
f(void) {}
int main(void) { return 0; }
" HAVE_ATTRIBUTE_DESTRUCTOR)
if(HAVE_ATTRIBUTE_DESTRUCTOR)
set(ATTRIBUTE_DESTRUCTOR "__attribute__((destructor))")
endif()
check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
check_function_exists(class HAVE_CLASS)
check_include_files(dlfcn.h HAVE_DLFCN_H)

View File

@ -1,6 +1,3 @@
/* A form that will not confuse apibuild.py */
#cmakedefine ATTRIBUTE_DESTRUCTOR @ATTRIBUTE_DESTRUCTOR@
/* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine HAVE_ARPA_INET_H 1

View File

@ -355,7 +355,6 @@ void __attribute__((destructor))
f(void) {}], [], [
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_ATTRIBUTE_DESTRUCTOR], [1],[Define if __attribute__((destructor)) is accepted])
AC_DEFINE([ATTRIBUTE_DESTRUCTOR], [__attribute__((destructor))],[A form that will not confuse apibuild.py])],[
AC_MSG_RESULT(no)])
dnl

View File

@ -53,6 +53,10 @@
#define ATTRIBUTE_UNUSED
#endif
#ifdef HAVE_ATTRIBUTE_DESTRUCTOR
#define ATTRIBUTE_DESTRUCTOR __attribute__((destructor))
#endif
#if defined(__clang__) || \
(defined(__GNUC__) && (__GNUC__ >= 8) && !defined(__EDG__))
#define ATTRIBUTE_NO_SANITIZE(arg) __attribute__((no_sanitize(arg)))

View File

@ -298,7 +298,6 @@ endif
### __attribute__((destructor))
if cc.has_function_attribute('destructor')
config_h.set10('HAVE_ATTRIBUTE_DESTRUCTOR', true)
config_h.set('ATTRIBUTE_DESTRUCTOR', '__attribute__((destructor))')
endif
### DSO support