mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 06:38:47 +00:00
wasm: support more vendor libraries
Adds support for: - box2d - cgltf - stb image - stb rect pack
This commit is contained in:
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
#ifdef NDEBUG
|
||||
#define assert(e) ((void)0)
|
||||
#else
|
||||
|
||||
#ifdef __FILE_NAME__
|
||||
#define __ASSERT_FILE_NAME __FILE_NAME__
|
||||
#else /* __FILE_NAME__ */
|
||||
#define __ASSERT_FILE_NAME __FILE__
|
||||
#endif /* __FILE_NAME__ */
|
||||
|
||||
void __odin_libc_assert_fail(const char *, const char *, int, const char *);
|
||||
|
||||
#define assert(e) \
|
||||
(__builtin_expect(!(e), 0) ? __odin_libc_assert_fail(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
|
||||
|
||||
#endif /* NDEBUG */
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
float sqrtf(float);
|
||||
float cosf(float);
|
||||
float sinf(float);
|
||||
float atan2f(float, float);
|
||||
bool isnan(float);
|
||||
bool isinf(float);
|
||||
double floor(double x);
|
||||
double ceil(double x);
|
||||
double sqrt(double x);
|
||||
double pow(double x, double y);
|
||||
double fmod(double x, double y);
|
||||
double cos(double x);
|
||||
double acos(double x);
|
||||
double fabs(double x);
|
||||
int abs(int);
|
||||
double ldexp(double, int);
|
||||
double exp(double);
|
||||
float log(float);
|
||||
float sin(float);
|
||||
Vendored
+47
@@ -0,0 +1,47 @@
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
typedef struct {} FILE;
|
||||
|
||||
#define SEEK_SET 0
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
|
||||
#define stdout ((FILE *)2)
|
||||
#define stderr ((FILE *)3)
|
||||
|
||||
FILE *fopen(const char *, char *);
|
||||
int fclose(FILE *);
|
||||
int fseek(FILE *, long, int);
|
||||
long ftell(FILE *);
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
|
||||
int vfprintf(FILE *, const char *, va_list);
|
||||
int vsnprintf(char *, size_t, const char *, va_list);
|
||||
|
||||
static inline int snprintf(char *buf, size_t size, const char *fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
int result = vsnprintf(buf, size, fmt, args);
|
||||
va_end(args);
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline int fprintf(FILE *f, const char *fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
int result = vfprintf(f, fmt, args);
|
||||
va_end(args);
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline int printf(const char *fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
int result = vfprintf(stdout, fmt, args);
|
||||
va_end(args);
|
||||
return result;
|
||||
}
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
#include <stddef.h>
|
||||
|
||||
void *malloc(size_t size);
|
||||
|
||||
void *aligned_alloc(size_t alignment, size_t size);
|
||||
|
||||
void free(void *);
|
||||
|
||||
void *realloc(void *, size_t);
|
||||
|
||||
void qsort(void* base, size_t num, size_t size, int (*compare)(const void*, const void*));
|
||||
|
||||
int atoi(const char *);
|
||||
long atol(const char *);
|
||||
long long atoll(const char *);
|
||||
|
||||
double atof(const char *);
|
||||
|
||||
long strtol(const char *, char **, int);
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
#include <stddef.h>
|
||||
|
||||
void *memcpy(void *, const void *, size_t);
|
||||
void *memset(void *, int, size_t);
|
||||
void *memmove(void *, void *, size_t);
|
||||
int memcmp(const void *, const void *, size_t);
|
||||
|
||||
unsigned long strlen(const char *str);
|
||||
|
||||
char *strchr(const char *, int);
|
||||
char *strrchr(const char *, int);
|
||||
|
||||
char *strncpy(char *, const char *, size_t);
|
||||
char *strcpy(char *, const char *);
|
||||
|
||||
size_t strcspn(const char *, const char *);
|
||||
|
||||
int strcmp(const char *, const char *);
|
||||
int strncmp(const char *, const char *, size_t);
|
||||
|
||||
char *strstr(const char *, const char *);
|
||||
Reference in New Issue
Block a user