Skip to content

Commit

Permalink
ansi build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Aug 6, 2024
1 parent 4c16a06 commit 697ccd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ccode/value.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void set_value_fn(char* name, char* value, bool read_only){
}
}
if(vars == NULL){
vars = calloc(1, sizeof(var_count));
vars = calloc(1, sizeof(variable));
}
vars = realloc(vars, (var_count+1)* sizeof(variable));
vars[var_count].name = strdup(name);
Expand Down
6 changes: 5 additions & 1 deletion src/include/value.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include <stdbool.h>
#include <string.h>
#ifdef __STRICT_ANSI__
#define strdup(A) strcpy(calloc(strlen(A) + 1, sizeof(char)), A);
#endif
char* get_value(char* name);
void set_value(char* name, char* value);
void set_value_readonly(char* name, char* value);
bool get_bool(char* name);
void set_bool(char* name, bool value);
char** get_variable_names(int* len);
char** get_variable_names(int* len);

0 comments on commit 697ccd8

Please sign in to comment.