2
0
Эх сурвалжийг харах

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

Ingwie Phoenix 6 жил өмнө
parent
commit
45f0d1065f

+ 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