diff --git a/htmlparser/src/nsParser.h b/htmlparser/src/nsParser.h
index adc5ff7de55..530c60e1466 100644
--- a/htmlparser/src/nsParser.h
+++ b/htmlparser/src/nsParser.h
@@ -70,7 +70,10 @@ class nsScanner;
class nsIParserFilter;
#include
+#ifndef XP_MAC
#pragma warning( disable : 4275 )
+#endif
+
CLASS_EXPORT_HTMLPARS nsParser : public nsIParser, public nsIStreamListener {
diff --git a/parser/htmlparser/src/nsParser.h b/parser/htmlparser/src/nsParser.h
index adc5ff7de55..530c60e1466 100644
--- a/parser/htmlparser/src/nsParser.h
+++ b/parser/htmlparser/src/nsParser.h
@@ -70,7 +70,10 @@ class nsScanner;
class nsIParserFilter;
#include
+#ifndef XP_MAC
#pragma warning( disable : 4275 )
+#endif
+
CLASS_EXPORT_HTMLPARS nsParser : public nsIParser, public nsIStreamListener {