start writing new VBE routines
[dosdemo] / src / util.h
index 6d200b7..6d869eb 100644 (file)
@@ -5,12 +5,15 @@
 
 #ifdef __GNUC__
 #define INLINE __inline
+#define PACKED __attribute__((packed))
 
 #elif defined(__WATCOMC__)
 #define INLINE __inline
+#define PACKED
 
 #else
 #define INLINE
+#define PACKED
 #endif
 
 /* fast conversion of double -> 32bit int
@@ -43,6 +46,9 @@ void perf_end(void);
        "sub eax, [perf_start_count]" \
        "mov [perf_interval_count], eax" \
        modify [eax ebx ecx edx];
+
+void debug_break(void);
+#pragma aux debug_break = "int 3";
 #endif
 
 #ifdef __GNUC__
@@ -63,6 +69,9 @@ void perf_end(void);
        : "=m"(perf_interval_count) \
        : "m"(perf_start_count) \
        : "%eax", "%ebx", "%ecx", "%edx")
+
+#define debug_break() \
+       asm volatile ("int $3")
 #endif
 
 #ifdef _MSC_VER
@@ -86,6 +95,11 @@ void perf_end(void);
                        mov [perf_interval_count], eax \
                } \
        } while(0)
+
+#define debug_break() \
+       do { \
+               __asm { int 3 } \
+       } while(0)
 #endif
 
 #endif /* UTIL_H_ */