Added ORCA_IMPORT to mark symbols imported from the runtime
This commit is contained in:
parent
28e0a6c88e
commit
bc03887148
|
@ -24,7 +24,7 @@ typedef struct log_output
|
|||
static log_output _logDefaultOutput = {.kind = ORCA_LOG_OUTPUT_CONSOLE};
|
||||
log_output* LOG_DEFAULT_OUTPUT = &_logDefaultOutput;
|
||||
|
||||
extern void orca_log(log_level level,
|
||||
void ORCA_IMPORT(orca_log)(log_level level,
|
||||
int fileLen,
|
||||
const char* file,
|
||||
int functionLen,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include"platform_memory.h"
|
||||
|
||||
extern void* orca_mem_grow(u64 size);
|
||||
void* ORCA_IMPORT(orca_mem_grow)(u64 size);
|
||||
|
||||
void* orca_mem_base_reserve(mem_base_allocator* context, u64 size)
|
||||
{
|
||||
|
|
|
@ -94,4 +94,9 @@
|
|||
#define mp_thread_local __thread
|
||||
#endif
|
||||
|
||||
|
||||
#if PLATFORM_ORCA
|
||||
#define ORCA_IMPORT(f) __attribute__((import_name(#f))) f
|
||||
#endif
|
||||
|
||||
#endif // __PLATFORM_H_
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//NOTE: assert macros
|
||||
#ifndef NO_ASSERT
|
||||
#ifdef PLATFORM_ORCA
|
||||
extern int orca_assert(const char* file, const char* function, int line, const char* src, const char* msg);
|
||||
int ORCA_IMPORT(orca_assert)(const char* file, const char* function, int line, const char* src, const char* msg);
|
||||
#define _ASSERT_(x, msg) ((x) || orca_assert(__FILE__, __FUNCTION__, __LINE__, #x, msg))
|
||||
#else
|
||||
#include<assert.h>
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
double fabs(double x);
|
||||
double sqrt(double sqrt);
|
||||
double cos(double x);
|
||||
double sin(double x);
|
||||
double ORCA_IMPORT(fabs)(double x);
|
||||
double ORCA_IMPORT(sqrt)(double sqrt);
|
||||
double ORCA_IMPORT(cos)(double x);
|
||||
double ORCA_IMPORT(sin)(double x);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue