aboutgitcodelistschat:MatrixIRC
path: root/operations.h
diff options
context:
space:
mode:
Diffstat (limited to 'operations.h')
-rw-r--r--operations.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/operations.h b/operations.h
index e9204d3..f543d7a 100644
--- a/operations.h
+++ b/operations.h
@@ -14,16 +14,17 @@
#include "common/util.h"
#define STACK_SIZE (1024 * 1024 / 8)
-#define HANDLE_OP(code, call, type) \
+#define HANDLE_OP(code, call, type, g) \
case code: \
do { \
+ struct op *start = (struct op *)g->inst; \
int res = call(req, notifier, g, &op->op.type); \
if (res == 0) \
(op)++; \
else if (res == -1) \
return -1; \
else \
- (op) += res; \
+ (op) = start + res; \
} while (0); \
break