Skip to content

Commit

Permalink
remove attributes in header file and add final newline
Browse files Browse the repository at this point in the history
  • Loading branch information
Laplace-Demon committed Jul 16, 2024
1 parent dc79a35 commit aba61ef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
23 changes: 13 additions & 10 deletions src/libc/include/owi.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
#ifndef _OWI_H
#define _OWI_H

void *owi_malloc(void *base, unsigned int size) __attribute__((import_module("summaries"))) __attribute__((import_name("alloc")));
void *owi_malloc(void *base, unsigned int size);

void owi_free(void *) __attribute__((import_module("summaries"))) __attribute__((import_name("dealloc")));
void owi_free(void *);

char owi_i8(void) __attribute__((import_module("symbolic"))) __attribute__((import_name("i8_symbol")));
char owi_i8(void);

int owi_i32(void) __attribute__((import_module("symbolic"))) __attribute__((import_name("i32_symbol")));
int owi_i32(void);

long long owi_i64(void) __attribute__((import_module("symbolic"))) __attribute__((import_name("i64_symbol")));
long long owi_i64(void);

float owi_f32(void) __attribute__((import_module("symbolic"))) __attribute__((import_name("f32_symbol")));
float owi_f32(void);

double owi_f64(void) __attribute__((import_module("symbolic"))) __attribute__((import_name("f64_symbol")));
double owi_f64(void);

_Bool owi_bool(void) __attribute__((import_module("symbolic"))) __attribute__((import_name("bool_symbol")));
_Bool owi_bool(void);

void owi_assume(int c) __attribute__((import_module("symbolic"))) __attribute__((import_name("assume")));
void owi_assert(int c) __attribute__((import_module("symbolic"))) __attribute__((import_name("assert")));
void owi_assume(int c);
void owi_assert(int c);

void owi_abort(void);
void owi_exit(int c);

#endif
6 changes: 4 additions & 2 deletions src/libc/src/owi.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ owi_assume(int);
__attribute__((import_module("symbolic"), import_name("assert"))) void
owi_assert(int);

__attribute__((weak, import_module("symbolic"), import_name("assume"))) void
assume(int);
__attribute__((import_module("summaries"))) __attribute__((import_name("abort"))) void
owi_abort(void);
__attribute__((import_module("summaries"))) __attribute__((import_name("exit"))) void
owi_exit(int);
6 changes: 3 additions & 3 deletions src/libc/src/stdlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#define ldbltype double
#endif

void owi_abort(void) __attribute__((import_module("summaries"))) __attribute__((import_name("abort")));
void owi_exit(int) __attribute__((import_module("summaries"))) __attribute__((import_name("exit")));

void abort(void) { owi_abort(); }
void exit(int status) { owi_exit(status); }

__attribute__((weak, import_module("symbolic"), import_name("assume"))) void
assume(int);

extern unsigned char __heap_base;
unsigned int bump_pointer = &__heap_base;

Expand Down

0 comments on commit aba61ef

Please sign in to comment.