-//@{
- /// check that expression is true, "return" if not (also FAILs in debug mode)
-#define wxCHECK(x, rc) if (!(x)) {wxFAIL; return rc; }
- /// as wxCHECK but with a message explaining why we fail
-#define wxCHECK_MSG(x, rc, msg) if (!(x)) {wxFAIL_MSG(msg); return rc; }
- /// check that expression is true, perform op if not
-#define wxCHECK2(x, op) if (!(x)) {wxFAIL; op; }
- /// as wxCHECK2 but with a message explaining why we fail
-#define wxCHECK2_MSG(x, op, msg) if (!(x)) {wxFAIL_MSG(msg); op; }
- /// special form of wxCHECK2: as wxCHECK, but for use in void functions
- // NB: there is only one form (with msg parameter) and it's intentional:
- // there is no other way to tell the caller what exactly went wrong
- // from the void function (of course, the function shouldn't be void
- // to begin with...)
-#define wxCHECK_RET(x, msg) if (!(x)) {wxFAIL_MSG(msg); return; }
-//@}
-
-//@}
-
-#endif // _WX_DEBUG_H_
+#ifdef __WATCOMC__
+ /* avoid "unused symbol" warning */
+ #define wxCOMPILE_TIME_ASSERT(expr, msg) \
+ class wxMAKE_UNIQUE_ASSERT_NAME { \
+ unsigned int msg: expr; \
+ wxMAKE_UNIQUE_ASSERT_NAME() { wxUnusedVar(msg); } \
+ }
+#else
+ #define wxCOMPILE_TIME_ASSERT(expr, msg) \
+ struct wxMAKE_UNIQUE_ASSERT_NAME { unsigned int msg: expr; }
+#endif
+
+/*
+ When using VC++ 6 with "Edit and Continue" on, the compiler completely
+ mishandles __LINE__ and so wxCOMPILE_TIME_ASSERT() doesn't work, provide a
+ way to make "unique" assert names by specifying a unique prefix explicitly
+ */
+#define wxMAKE_UNIQUE_ASSERT_NAME2(text) wxCONCAT(wxAssert_, text)
+
+#ifdef __WATCOMC__
+ /* avoid "unused symbol" warning */
+ #define wxCOMPILE_TIME_ASSERT2(expr, msg, text) \
+ class wxMAKE_UNIQUE_ASSERT_NAME2(text) { \
+ unsigned int msg: expr; \
+ wxMAKE_UNIQUE_ASSERT_NAME2(text) { wxUnusedVar(msg); } \
+ }
+#else
+ #define wxCOMPILE_TIME_ASSERT2(expr, msg, text) \
+ struct wxMAKE_UNIQUE_ASSERT_NAME2(text) { unsigned int msg: expr; }
+#endif
+
+/* helpers for wxCOMPILE_TIME_ASSERT below, for private use only */
+#define wxMAKE_BITSIZE_MSG(type, size) type ## SmallerThan ## size ## Bits
+
+/* a special case of compile time assert: check that the size of the given type */
+/* is at least the given number of bits */
+#define wxASSERT_MIN_BITSIZE(type, size) \
+ wxCOMPILE_TIME_ASSERT(sizeof(type) * CHAR_BIT >= size, \
+ wxMAKE_BITSIZE_MSG(type, size))
+
+/* ---------------------------------------------------------------------------- */
+/* other miscellaneous debugger-related functions */
+/* ---------------------------------------------------------------------------- */
+
+/* return true if we're running under debugger */
+/* */
+/* currently this only really works under Mac in CodeWarrior builds, it always */
+/* returns false otherwise */
+#ifdef __cplusplus
+ #ifdef __WXMAC__
+ extern bool WXDLLIMPEXP_BASE wxIsDebuggerRunning();
+ #else /* !Mac */
+ inline bool wxIsDebuggerRunning() { return false; }
+ #endif /* Mac/!Mac */
+#endif /* __cplusplus */
+
+#endif /* _WX_DEBUG_H_ */
+