Land all the changes to make JSCore build again on windows.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/kxmlcore/Assertions.h b/JavaScriptCore/kxmlcore/Assertions.h
index af7cb25..cf40dde 100644
--- a/JavaScriptCore/kxmlcore/Assertions.h
+++ b/JavaScriptCore/kxmlcore/Assertions.h
@@ -35,11 +35,15 @@
 // For non-debug builds, everything is disabled by default.
 // Defining any of the symbols explicitly prevents this from having any effect.
 
+#ifdef WIN32
+#define ASSERT_DISABLED 1 // FIXME: We have to undo all the assert macros, since they are currently in a .mm file and use obj-c.
+#else
 #ifdef NDEBUG
 #define ASSERTIONS_DISABLED_DEFAULT 1
 #else
 #define ASSERTIONS_DISABLED_DEFAULT 0
 #endif
+#endif
 
 #ifndef ASSERT_DISABLED
 #define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT
@@ -61,6 +65,12 @@
 #define LOG_DISABLED ASSERTIONS_DISABLED_DEFAULT
 #endif
 
+#ifdef __GNUC__
+#define KXMLCORE_PRETTY_FUNCTION __PRETTY_FUNCTION__
+#else
+#define KXMLCORE_PRETTY_FUNCTION __FUNCTION__
+#endif
+
 // These helper functions are always declared, but not necessarily always defined if the corresponding function is disabled.
 
 #ifdef __cplusplus
@@ -74,7 +84,7 @@
     const char *defaultName;
     KXCLogChannelState state;
 } KXCLogChannel;
-    
+
 void KXCReportAssertionFailure(const char *file, int line, const char *function, const char *assertion);
 void KXCReportAssertionFailureWithMessage(const char *file, int line, const char *function, const char *assertion, const char *format, ...);
 void KXCReportArgumentAssertionFailure(const char *file, int line, const char *function, const char *argName, const char *assertion);
@@ -95,25 +105,25 @@
 #if ASSERT_DISABLED
 
 #define ASSERT(assertion) ((void)0)
-#define ASSERT_WITH_MESSAGE(assertion, formatAndArgs...) ((void)0)
+#define ASSERT_WITH_MESSAGE(assertion, formatAndArgs, ...) ((void)0)
 #define ASSERT_NOT_REACHED() ((void)0)
 
 #else
 
 #define ASSERT(assertion) do \
     if (!(assertion)) { \
-        KXCReportAssertionFailure(__FILE__, __LINE__, __PRETTY_FUNCTION__, #assertion); \
+        KXCReportAssertionFailure(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, #assertion); \
         CRASH(); \
     } \
 while (0)
-#define ASSERT_WITH_MESSAGE(assertion, formatAndArgs...) do \
+#define ASSERT_WITH_MESSAGE(assertion, formatAndArgs, ...) do \
     if (!(assertion)) { \
-        KXCReportAssertionFailureWithMessage(__FILE__, __LINE__, __PRETTY_FUNCTION__, #assertion, formatAndArgs); \
+        KXCReportAssertionFailureWithMessage(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, #assertion, formatAndArgs); \
         CRASH(); \
     } \
 while (0)
 #define ASSERT_NOT_REACHED() do { \
-    KXCReportAssertionFailure(__FILE__, __LINE__, __PRETTY_FUNCTION__, 0); \
+    KXCReportAssertionFailure(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, 0); \
     CRASH(); \
 } while (0)
 
@@ -129,7 +139,7 @@
 
 #define ASSERT_ARG(argName, assertion) do \
     if (!(assertion)) { \
-        KXCReportArgumentAssertionFailure(__FILE__, __LINE__, __PRETTY_FUNCTION__, #argName, #assertion); \
+        KXCReportArgumentAssertionFailure(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, #argName, #assertion); \
         CRASH(); \
     } \
 while (0)
@@ -139,10 +149,10 @@
 // FATAL
 
 #if FATAL_DISABLED
-#define FATAL(formatAndArgs...) ((void)0)
+#define FATAL(formatAndArgs, ...) ((void)0)
 #else
-#define FATAL(formatAndArgs...) do { \
-    KXCReportFatalError(__FILE__, __LINE__, __PRETTY_FUNCTION__, formatAndArgs); \
+#define FATAL(formatAndArgs, ...) do { \
+    KXCReportFatalError(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, formatAndArgs); \
     CRASH(); \
 } while (0)
 #endif
@@ -150,17 +160,17 @@
 // ERROR
 
 #if ERROR_DISABLED
-#define ERROR(formatAndArgs...) ((void)0)
+#define ERROR(formatAndArgs, ...) ((void)0)
 #else
-#define ERROR(formatAndArgs...) KXCReportError(__FILE__, __LINE__, __PRETTY_FUNCTION__, formatAndArgs)
+#define ERROR(formatAndArgs, ...) KXCReportError(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, formatAndArgs)
 #endif
 
 // LOG
 
 #if LOG_DISABLED
-#define LOG(channel, formatAndArgs...) ((void)0)
+#define LOG(channel, formatAndArgs, ...) ((void)0)
 #else
-#define LOG(channel, formatAndArgs...) KXCLog(__FILE__, __LINE__, __PRETTY_FUNCTION__, &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), formatAndArgs)
+#define LOG(channel, formatAndArgs, ...) KXCLog(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), formatAndArgs)
 #define JOIN_LOG_CHANNEL_WITH_PREFIX(prefix, channel) JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel)
 #define JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel) prefix ## channel
 #endif