]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - exec.c
Allow testsuite to pass on big endian
[xonotic/gmqcc.git] / exec.c
diff --git a/exec.c b/exec.c
index d4e75b82e8b580394a8d0300ead3705b1364486f..0bf9fdf4c484c8363dfedb89da0e7e17cd06c71b 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -66,6 +66,8 @@ qc_program_t* prog_load(const char *filename, bool skipversion)
         return NULL;
     }
 
         return NULL;
     }
 
+    util_swap_header(&header);
+
     if (!skipversion && header.version != 6) {
         loaderror("header says this is a version %i progs, we need version 6\n", header.version);
         fs_file_close(file);
     if (!skipversion && header.version != 6) {
         loaderror("header says this is a version %i progs, we need version 6\n", header.version);
         fs_file_close(file);
@@ -114,6 +116,12 @@ qc_program_t* prog_load(const char *filename, bool skipversion)
     read_data1(strings);
     read_data2(globals, 2); /* reserve more in case a RETURN using with the global at "the end" exists */
 
     read_data1(strings);
     read_data2(globals, 2); /* reserve more in case a RETURN using with the global at "the end" exists */
 
+    util_swap_statements (prog->code);
+    util_swap_defs_fields(prog->defs);
+    util_swap_defs_fields(prog->fields);
+    util_swap_functions  (prog->functions);
+    util_swap_globals    (prog->globals);
+
     fs_file_close(file);
 
     /* profile counters */
     fs_file_close(file);
 
     /* profile counters */