aboutsummaryrefslogtreecommitdiff
path: root/src/bytecode
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytecode')
-rw-r--r--src/bytecode/bytecode.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/bytecode/bytecode.c b/src/bytecode/bytecode.c
index 0a2b157..3b6d980 100644
--- a/src/bytecode/bytecode.c
+++ b/src/bytecode/bytecode.c
@@ -48,15 +48,12 @@ CHECK_RESULT int buffer_append_header(Buffer *program_data) {
*/
BytecodeHeader header;
- header.magic_number = AMAL_BYTECODE_MAGIC_NUMBER;
+ am_memcpy(header.magic_number, AMAL_BYTECODE_MAGIC_NUMBER, AMAL_BYTECODE_MAGIC_NUMBER_SIZE);
header.major_version = AMAL_BYTECODE_MAJOR_VERSION;
header.minor_version = AMAL_BYTECODE_MINOR_VERSION;
header.patch_version = AMAL_BYTECODE_PATCH_VERSION;
-#if defined(AMAL_LITTLE_ENDIAN)
- header.endian = 0;
-#elif defined(AMAL_BIG_ENDIAN)
- header.magic_number = byteswap32(header.magic_number);
- header.endian = 1;
+#if defined(AMAL_BIG_ENDIAN)
+ #error TODO: convert bytecode to little endian
#endif
return_if_error(buffer_append(program_data, &header, sizeof(header)));