#endif
#endif
+
+/* MSVC bebore VC7 does not have the __FUNCTION__ macro */
+#if defined(_MSC_VER) && _MSC_VER < 1300
+#define __FUNCTION__ "???"
+#endif
+
void _debug_vprintf(const char *format, va_list ap);
va_start(ap, format);
_debug_vprintf(format, ap);
va_end(ap);
+#else
+ (void) format; /* silence warning */
#endif
}
#endif
+#ifdef DEBUG
/**
* Dump a blob in hex to the same place that debug_printf sends its
* messages.
*/
-#ifdef DEBUG
-void debug_print_blob( const char *name,
- const void *blob,
- unsigned size );
+void debug_print_blob( const char *name, const void *blob, unsigned size );
+
+/* Print a message along with a prettified format string
+ */
+void debug_print_format(const char *msg, unsigned fmt );
#else
#define debug_print_blob(_name, _blob, _size) ((void)0)
+#define debug_print_format(_msg, _fmt) ((void)0)
#endif
* Hard-coded breakpoint.
*/
#ifdef DEBUG
-#if (defined(__i386__) || defined(__386__)) && defined(__GNUC__)
+#if defined(PIPE_ARCH_X86) && defined(PIPE_CC_GCC)
#define debug_break() __asm("int3")
-#elif (defined(__i386__) || defined(__386__)) && defined(__MSC__)
-#define debug_break() _asm {int 3}
+#elif defined(PIPE_ARCH_X86) && defined(PIPE_CC_MSVC)
+#define debug_break() do { _asm {int 3} } while(0)
#else
#define debug_break() _debug_break()
#endif
debug_get_bool_option(const char *name, boolean dfault);
long
-debug_get_unsigned_option(const char *name, long dfault);
+debug_get_num_option(const char *name, long dfault);
unsigned long
debug_get_flags_option(const char *name,
debug_realloc(const char *file, unsigned line, const char *function,
void *old_ptr, size_t old_size, size_t new_size );
+unsigned long
+debug_memory_begin(void);
+
void
-debug_memory_reset(void);
+debug_memory_end(unsigned long beginning);
+
+
+#if defined(PROFILE) && defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
+
+void
+debug_profile_start(void);
void
-debug_memory_report(void);
+debug_profile_stop(void);
+
+#endif
+
+
+#ifdef DEBUG
+void debug_dump_image(const char *prefix,
+ unsigned format, unsigned cpp,
+ unsigned width, unsigned height,
+ unsigned pitch,
+ const void *data);
+#else
+#define debug_dump_image(prefix, format, cpp, width, height, pitch, data) ((void)0)
+#endif
#ifdef __cplusplus