newer msvc's are aware of __FUNCTION__
[reactos.git] / reactos / include / wine / debug.h
index afe27cf..80f7ca0 100644 (file)
@@ -2,14 +2,28 @@
 #define __WINE_DEBUG_H
 
 #include "../roscfg.h"
-#if ! defined(DBG) || ! defined(YDEBUG)
-#define NDEBUG
-#endif
-#include "../debug.h"
 #include <stdarg.h>
+#include <windows.h>
 #include <wchar.h>
 
-ULONG DbgPrint(PCH Format,...);
+/* Add ROS Master debug functions if not added yet */
+#ifndef __INTERNAL_DEBUG
+#ifdef YDEBUG
+#undef NDEBUG
+#else
+#define NDEBUG
+#endif
+#include <reactos/debug.h>
+#endif
+
+#ifndef __GNUC__
+#if !defined(_MSC_VER) || _MSC_VER < 8
+#define        __FUNCTION__ ""
+#endif//_MSC_VER
+#define        inline __inline
+#endif
+
+unsigned long DbgPrint(char *Format,...);
 
 struct _GUID;
 
@@ -18,17 +32,38 @@ struct _GUID;
 /* These function return a printable version of a string, including
    quotes.  The string will be valid for some time, but not indefinitely
    as strings are re-used.  */
+extern const char *wine_dbgstr_w( const WCHAR *s );
 extern const char *wine_dbgstr_an( const char * s, int n );
-extern const char *wine_dbgstr_wn( const WCHAR *s, int n );
+extern const char *wine_dbgstr_wn( const wchar_t *s, int n );
 extern const char *wine_dbgstr_guid( const struct _GUID *id );
+extern const char *wine_dbgstr_longlong( unsigned long long ll );
+extern const char *wine_dbg_sprintf( const char *format, ... );
 
 inline static const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); }
-inline static const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); }
+inline static const char *debugstr_wn( const wchar_t *s, int n ) { return wine_dbgstr_wn( s, n ); }
 inline static const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); }
 inline static const char *debugstr_a( const char *s )  { return wine_dbgstr_an( s, 80 ); }
-inline static const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, 80 ); }
+inline static const char *debugstr_w( const wchar_t *s ) { return wine_dbgstr_wn( s, 80 ); }
 inline static const char *debugres_a( const char *s )  { return wine_dbgstr_an( s, 80 ); }
-inline static const char *debugres_w( const WCHAR *s ) { return wine_dbgstr_wn( s, 80 ); }
+inline static const char *debugres_w( const wchar_t *s ) { return wine_dbgstr_wn( s, 80 ); }
+
+static inline const char *wine_dbgstr_point( const POINT *pt )
+{
+    if (!pt) return "(null)";
+    return wine_dbg_sprintf( "(%ld,%ld)", pt->x, pt->y );
+}
+
+static inline const char *wine_dbgstr_size( const SIZE *size )
+{
+    if (!size) return "(null)";
+    return wine_dbg_sprintf( "(%ld,%ld)", size->cx, size->cy );
+}
+
+static inline const char *wine_dbgstr_rect( const RECT *rect )
+{
+    if (!rect) return "(null)";
+    return wine_dbg_sprintf( "(%ld,%ld)-(%ld,%ld)", rect->left, rect->top, rect->right, rect->bottom );
+}
 
 #define TRACE        DPRINT
 #define TRACE_(ch)   DPRINT
@@ -38,6 +73,14 @@ inline static const char *debugres_w( const WCHAR *s ) { return wine_dbgstr_wn(
 #define TRACE_ON(ch) 1
 #endif
 
+#define WINE_TRACE        DPRINT
+#define WINE_TRACE_(ch)   DPRINT
+#ifdef NDEBUG
+#define WINE_TRACE_ON(ch) 0
+#else
+#define WINE_TRACE_ON(ch) 1
+#endif
+
 #define WARN         DPRINT
 #define WARN_(ch)    DPRINT
 #ifdef NDEBUG
@@ -46,6 +89,9 @@ inline static const char *debugres_w( const WCHAR *s ) { return wine_dbgstr_wn(
 #define WARN_ON(ch)  1
 #endif
 
+#ifdef FIXME
+#undef FIXME
+#endif
 #define FIXME        DPRINT1
 #define FIXME_(ch)   DPRINT1
 #ifdef NDEBUG
@@ -54,14 +100,33 @@ inline static const char *debugres_w( const WCHAR *s ) { return wine_dbgstr_wn(
 #define FIXME_ON(ch) 1
 #endif
 
-#define ERR          DPRINT
-#define ERR_(ch)     DPRINT
+#ifdef WINE_FIXME
+#undef WINE_FIXME
+#endif
+#define WINE_FIXME        DPRINT1
+#define WINE_FIXME_(ch)   DPRINT1
+#ifdef NDEBUG
+#define WINE_FIXME_ON(ch) 0
+#else
+#define WINE_FIXME_ON(ch) 1
+#endif
+
+#define ERR          DPRINT1
+#define ERR_(ch)     DPRINT1
 #ifdef NDEBUG
 #define ERR_ON(ch)   0
 #else
 #define ERR_ON(ch)   1
 #endif
 
+#define WINE_ERR          DPRINT1
+#define WINE_ERR_(ch)     DPRINT1
+#ifdef NDEBUG
+#define WINE_ERR_ON(ch)   0
+#else
+#define WINE_ERR_ON(ch)   1
+#endif
+
 #define DECLARE_DEBUG_CHANNEL(ch)
 #define DEFAULT_DEBUG_CHANNEL(ch)