mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-24 06:50:08 +03:00
cmake: fix ATTRIBUTE_DESTRUCTOR
definition
The code expects it to be set to the attribute for `xmlDestructor`, but in CMake, it is only ever available as `1` or undefined. Instead, match the behavior or autoconf.
This commit is contained in:
parent
3ba59b9349
commit
f86082359b
@ -139,7 +139,10 @@ else()
|
||||
void __attribute__((destructor))
|
||||
f(void) {}
|
||||
int main(void) { return 0; }
|
||||
" ATTRIBUTE_DESTRUCTOR)
|
||||
" HAVE_ATTRIBUTE_DESTRUCTOR)
|
||||
if(HAVE_ATTRIBUTE_DESTRUCTOR)
|
||||
set(ATTRIBUTE_DESTRUCTOR "__attribute__((destructor))")
|
||||
endif()
|
||||
check_c_source_compiles("
|
||||
#include <netdb.h>
|
||||
int main() { (void) gethostbyname((const char*) \"\"); return 0; }
|
||||
|
@ -2,7 +2,7 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if __attribute__((destructor)) is accepted */
|
||||
#cmakedefine ATTRIBUTE_DESTRUCTOR 1
|
||||
#cmakedefine ATTRIBUTE_DESTRUCTOR @ATTRIBUTE_DESTRUCTOR@
|
||||
|
||||
/* Type cast for the gethostbyname() argument */
|
||||
#cmakedefine GETHOSTBYNAME_ARG_CAST @GETHOSTBYNAME_ARG_CAST@
|
||||
|
Loading…
x
Reference in New Issue
Block a user