summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorTomasz Konojacki <me@xenu.pl>2019-04-04 22:39:38 +0200
committerKarl Williamson <khw@cpan.org>2019-04-05 22:51:00 -0600
commit6879a07bc8b8e75c35d0e3b765ea718cc1c7aeb2 (patch)
tree59a3fdded5022da4f20985c5d4dada92078497a7 /perl.h
parentbc035eed7aac5997a56d34b98261cc7a99da4787 (diff)
downloadperl-6879a07bc8b8e75c35d0e3b765ea718cc1c7aeb2.tar.gz
implement diagnostics ignore/restore macros for Visual C++
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 6c3002a5dd..df2fc1a9c2 100644
--- a/perl.h
+++ b/perl.h
@@ -448,6 +448,19 @@
#define CLANG_DIAG_IGNORE_STMT(x) CLANG_DIAG_IGNORE(x) NOOP
#define CLANG_DIAG_RESTORE_STMT CLANG_DIAG_RESTORE NOOP
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+# define MSVC_DIAG_IGNORE(x) __pragma(warning(push)) \
+ __pragma(warning(disable : x))
+# define MSVC_DIAG_RESTORE __pragma(warning(pop))
+#else
+# define MSVC_DIAG_IGNORE(x)
+# define MSVC_DIAG_RESTORE
+#endif
+#define MSVC_DIAG_IGNORE_DECL(x) MSVC_DIAG_IGNORE(x) dNOOP
+#define MSVC_DIAG_RESTORE_DECL MSVC_DIAG_RESTORE dNOOP
+#define MSVC_DIAG_IGNORE_STMT(x) MSVC_DIAG_IGNORE(x) NOOP
+#define MSVC_DIAG_RESTORE_STMT MSVC_DIAG_RESTORE NOOP
+
#define NOOP /*EMPTY*/(void)0
#define dNOOP struct Perl___notused_struct