Skip to content

Commit 85e0d86

Browse files
committed
fix: export bytecode emission API and resolve test build errors
1 parent 539e0b7 commit 85e0d86

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/bytecode.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
#define AM_CONST 1
1414

15+
#ifndef OP_PUSH_CONST
16+
#define OP_PUSH_CONST OP_CONSTANT
17+
#endif
18+
1519
// OpCodes
1620
typedef enum {
1721
OP_CONSTANT,
@@ -103,4 +107,12 @@ int read_chunk_from_file(const char *path, Chunk *out);
103107
uint64_t read_uleb128_from(const uint8_t *buf, size_t buf_len, size_t *out_read);
104108
int64_t read_sleb128_from(const uint8_t *buf, size_t buf_len, size_t *out_read);
105109

110+
// Emission helpers
111+
void emit_opcode(Chunk *chunk, OpCode op);
112+
void emit_u8(Chunk *chunk, uint8_t x);
113+
void emit_u16_le(Chunk *chunk, uint16_t x);
114+
void emit_u32_le(Chunk *chunk, uint32_t x);
115+
void emit_uleb128(Chunk *chunk, uint64_t value);
116+
void emit_sleb128(Chunk *chunk, int64_t value);
117+
106118
#endif // PROX_BYTECODE_H

0 commit comments

Comments
 (0)