Ignore:
Timestamp:
Jan 6, 2006, 2:43:44 PM (19 years ago)
Author:
hyatt
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kxmlcore/Assertions.h

    r10634 r11918  
    3636// Defining any of the symbols explicitly prevents this from having any effect.
    3737
     38#ifdef WIN32
     39#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.
     40#else
    3841#ifdef NDEBUG
    3942#define ASSERTIONS_DISABLED_DEFAULT 1
    4043#else
    4144#define ASSERTIONS_DISABLED_DEFAULT 0
     45#endif
    4246#endif
    4347
     
    6266#endif
    6367
     68#ifdef __GNUC__
     69#define KXMLCORE_PRETTY_FUNCTION __PRETTY_FUNCTION__
     70#else
     71#define KXMLCORE_PRETTY_FUNCTION __FUNCTION__
     72#endif
     73
    6474// These helper functions are always declared, but not necessarily always defined if the corresponding function is disabled.
    6575
     
    7585    KXCLogChannelState state;
    7686} KXCLogChannel;
    77    
     87
    7888void KXCReportAssertionFailure(const char *file, int line, const char *function, const char *assertion);
    7989void KXCReportAssertionFailureWithMessage(const char *file, int line, const char *function, const char *assertion, const char *format, ...);
     
    96106
    97107#define ASSERT(assertion) ((void)0)
    98 #define ASSERT_WITH_MESSAGE(assertion, formatAndArgs...) ((void)0)
     108#define ASSERT_WITH_MESSAGE(assertion, formatAndArgs, ...) ((void)0)
    99109#define ASSERT_NOT_REACHED() ((void)0)
    100110
     
    103113#define ASSERT(assertion) do \
    104114    if (!(assertion)) { \
    105         KXCReportAssertionFailure(__FILE__, __LINE__, __PRETTY_FUNCTION__, #assertion); \
     115        KXCReportAssertionFailure(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, #assertion); \
    106116        CRASH(); \
    107117    } \
    108118while (0)
    109 #define ASSERT_WITH_MESSAGE(assertion, formatAndArgs...) do \
     119#define ASSERT_WITH_MESSAGE(assertion, formatAndArgs, ...) do \
    110120    if (!(assertion)) { \
    111         KXCReportAssertionFailureWithMessage(__FILE__, __LINE__, __PRETTY_FUNCTION__, #assertion, formatAndArgs); \
     121        KXCReportAssertionFailureWithMessage(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, #assertion, formatAndArgs); \
    112122        CRASH(); \
    113123    } \
    114124while (0)
    115125#define ASSERT_NOT_REACHED() do { \
    116     KXCReportAssertionFailure(__FILE__, __LINE__, __PRETTY_FUNCTION__, 0); \
     126    KXCReportAssertionFailure(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, 0); \
    117127    CRASH(); \
    118128} while (0)
     
    130140#define ASSERT_ARG(argName, assertion) do \
    131141    if (!(assertion)) { \
    132         KXCReportArgumentAssertionFailure(__FILE__, __LINE__, __PRETTY_FUNCTION__, #argName, #assertion); \
     142        KXCReportArgumentAssertionFailure(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, #argName, #assertion); \
    133143        CRASH(); \
    134144    } \
     
    140150
    141151#if FATAL_DISABLED
    142 #define FATAL(formatAndArgs...) ((void)0)
     152#define FATAL(formatAndArgs, ...) ((void)0)
    143153#else
    144 #define FATAL(formatAndArgs...) do { \
    145     KXCReportFatalError(__FILE__, __LINE__, __PRETTY_FUNCTION__, formatAndArgs); \
     154#define FATAL(formatAndArgs, ...) do { \
     155    KXCReportFatalError(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, formatAndArgs); \
    146156    CRASH(); \
    147157} while (0)
     
    151161
    152162#if ERROR_DISABLED
    153 #define ERROR(formatAndArgs...) ((void)0)
     163#define ERROR(formatAndArgs, ...) ((void)0)
    154164#else
    155 #define ERROR(formatAndArgs...) KXCReportError(__FILE__, __LINE__, __PRETTY_FUNCTION__, formatAndArgs)
     165#define ERROR(formatAndArgs, ...) KXCReportError(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, formatAndArgs)
    156166#endif
    157167
     
    159169
    160170#if LOG_DISABLED
    161 #define LOG(channel, formatAndArgs...) ((void)0)
     171#define LOG(channel, formatAndArgs, ...) ((void)0)
    162172#else
    163 #define LOG(channel, formatAndArgs...) KXCLog(__FILE__, __LINE__, __PRETTY_FUNCTION__, &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), formatAndArgs)
     173#define LOG(channel, formatAndArgs, ...) KXCLog(__FILE__, __LINE__, KXMLCORE_PRETTY_FUNCTION, &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), formatAndArgs)
    164174#define JOIN_LOG_CHANNEL_WITH_PREFIX(prefix, channel) JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel)
    165175#define JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel) prefix ## channel
Note: See TracChangeset for help on using the changeset viewer.