fix: compilation on Linux, using eax for return code
This commit is contained in:
@@ -381,5 +381,5 @@ void _xor() {
|
||||
}
|
||||
|
||||
void end() {
|
||||
state->should_exit = 0; //could use EAX for return code but i don't think i care
|
||||
state->should_exit = 0;
|
||||
}
|
||||
|
||||
@@ -87,6 +87,10 @@ int get_exit_state() {
|
||||
return state->should_exit;
|
||||
}
|
||||
|
||||
int get_exit_code() {
|
||||
return state->registers->eax;
|
||||
}
|
||||
|
||||
LABEL_ERR add_label(char *label, int line) {
|
||||
if (label == NULL)
|
||||
return LABEL_INVALID;
|
||||
@@ -191,7 +195,7 @@ ARRAY_ERR add_array(char* line) {
|
||||
}
|
||||
arr_char[i++] = (long long)* ptr++;
|
||||
}
|
||||
state->ARRAYS_VALUES[state->num_arrays++] = arr_char;
|
||||
state->ARRAYS_VALUES[state->num_arrays++] = (long long *)arr_char;
|
||||
return ARRAY_OK;
|
||||
}
|
||||
ptr = strtok_(ptr, ",");
|
||||
|
||||
@@ -76,6 +76,7 @@ int init_state();
|
||||
void free__state();
|
||||
void set_exit_state(int exit_state);
|
||||
int get_exit_state();
|
||||
int get_exit_code();
|
||||
LABEL_ERR add_label(char *label, int line);
|
||||
ARRAY_ERR add_array(char *line);
|
||||
void sanitize_arguments();
|
||||
|
||||
@@ -202,7 +202,7 @@ int pasm_run_script(const char *filename, char **file, size_t lines, int _fstrea
|
||||
free_(line);
|
||||
}
|
||||
|
||||
int ret_code = get_exit_state();
|
||||
int ret_code = get_exit_code();
|
||||
free__script(file);
|
||||
return ret_code;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user