1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

Visual Studio builds: Allow silencing deprecation warnings

Define XML_IGNORE_DEPRECATION_WARNINGS and the corresponding XML_POP_WARNINGS
for Visual Studio, and consequently define XML_IGNORE_FPTR_CAST_WARNINGS so
that we do not get a compiler warning on Visual Studio by doing a
__pragma(warning(pop)) without a corresponding __pragma(warning(push)).

Also correct the documentation a bit for XML_POP_WARNINGS.
This commit is contained in:
Chun-wei Fan
2022-11-22 14:56:58 +08:00
parent b9590d5d81
commit 707ade225c
2 changed files with 17 additions and 3 deletions

View File

@@ -68,6 +68,10 @@
#define XML_IGNORE_DEPRECATION_WARNINGS \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#elif defined (_MSC_VER) && (_MSC_VER >= 1400)
#define XML_IGNORE_DEPRECATION_WARNINGS \
__pragma(warning(push)) \
__pragma(warning(disable : 4996))
#else
#define XML_IGNORE_DEPRECATION_WARNINGS
#endif