Browse Source

Added small debugging helper. May be useful for other extensions or situations. Also a sneaky way to hide printf()s.

Ingwie Phoenix 6 năm trước cách đây
mục cha
commit
45f0d1065f
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      src/utils/gravity_debug.h

+ 6 - 0
src/utils/gravity_debug.h

@@ -15,4 +15,10 @@ const char *opcode_constname (int n);
 const char *opcode_name (opcode_t op);
 const char *gravity_disassemble (gravity_vm *vm, gravity_function_t *f, const char *bcode, uint32_t blen, bool deserialize);
 
+#ifdef GRAVITY_DEBUG
+#define GRAVITY_DEBUG_PRINT(...) printf(__VA_ARGS__)
+#else
+#define GRAVITY_DEBUG_PRINT(...) ((void)0)
+#endif
+
 #endif