mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
Fix rebuilding docs, by hiding __attribute__((...)) behind a macro.
When enabled via `./configure --enable-rebuild-docs`,
`make -C doc libxml2-api.xml` will invoke apibuild.py
to rebuild libxml2-api.xml from the sources.
But the code added in
9fa3200cb3 made it error out with
```
Parsing ../parser.c
Parse Error: parsing type : expecting a name
('Got token ', ('sep', '('))
('Last token: ', ('sep', '('))
('Token queue: ', [('name', 'destructor'), ('sep', ')'), ('sep', ')')])
('Line 14689 end: ', '')
```
This commit is contained in:
committed by
Nick Wellnhofer
parent
9f42f6baaa
commit
43a8836cde
@@ -647,7 +647,8 @@ AC_TRY_COMPILE2([
|
||||
void __attribute__((destructor))
|
||||
f(void) {}], [], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([ATTRIBUTE_DESTRUCTOR], [1],[Define if __attribute__((destructor)) is accepted])],[
|
||||
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)])
|
||||
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ ignored_words = {
|
||||
"__declspec": (3, "Windows keyword"),
|
||||
"__stdcall": (0, "Windows keyword"),
|
||||
"ATTRIBUTE_UNUSED": (0, "macro keyword"),
|
||||
"ATTRIBUTE_DESTRUCTOR": (0, "macro keyword"),
|
||||
"LIBEXSLT_PUBLIC": (0, "macro keyword"),
|
||||
"X_IN_Y": (5, "macro function builder"),
|
||||
"ATTRIBUTE_ALLOC_SIZE": (3, "macro for gcc checking extension"),
|
||||
|
||||
4
parser.c
4
parser.c
@@ -14691,10 +14691,10 @@ xmlCleanupParser(void) {
|
||||
xmlParserInitialized = 0;
|
||||
}
|
||||
|
||||
#if defined(ATTRIBUTE_DESTRUCTOR) && !defined(LIBXML_STATIC) && \
|
||||
#if defined(HAVE_ATTRIBUTE_DESTRUCTOR) && !defined(LIBXML_STATIC) && \
|
||||
!defined(_WIN32)
|
||||
static void
|
||||
__attribute__((destructor))
|
||||
ATTRIBUTE_DESTRUCTOR
|
||||
xmlDestructor(void) {
|
||||
xmlCleanupParser();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user