Use one libc wrapper copy for sgx and other platforms (#107)
And remove bh_printf macro for other platform header files
This commit is contained in:
@ -26,9 +26,7 @@
|
||||
#define DEFAULT_MEM_ALLOCATOR MEM_ALLOCATOR_EMS
|
||||
|
||||
/* Beihai log system */
|
||||
#ifndef BEIHAI_ENABLE_LOG
|
||||
#define BEIHAI_ENABLE_LOG 1
|
||||
#endif
|
||||
|
||||
/* Beihai debugger support */
|
||||
#define BEIHAI_ENABLE_TOOL_AGENT 1
|
||||
@ -129,3 +127,7 @@
|
||||
/* Default base offset of external memory space */
|
||||
#define DEFAULT_EXT_MEM_BASE_OFFSET (-2 * BH_GB)
|
||||
|
||||
#ifndef bh_printf
|
||||
#define bh_printf printf
|
||||
#endif
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ int gci_check_platform()
|
||||
{
|
||||
#define CHECK(x, y) do { \
|
||||
if((x) != (y)) { \
|
||||
bh_printf("Platform checking failed on LINE %d at FILE %s.", \
|
||||
bh_printf("Platform checking failed on LINE %d at FILE %s.",\
|
||||
__LINE__, __FILE__); \
|
||||
return GC_ERROR; \
|
||||
} \
|
||||
|
||||
@ -52,8 +52,6 @@ typedef int64_t int64;
|
||||
#define wa_free bh_free
|
||||
#define wa_strdup bh_strdup
|
||||
|
||||
#define bh_printf printf
|
||||
|
||||
typedef aos_task_t korp_thread;
|
||||
typedef korp_thread *korp_tid;
|
||||
typedef aos_task_t *aos_tid_t;
|
||||
|
||||
@ -52,7 +52,7 @@ void bh_set_print_function(bh_print_function_t pf)
|
||||
print_function = pf;
|
||||
}
|
||||
|
||||
int bh_printf(const char *message, ...)
|
||||
int bh_printf_sgx(const char *message, ...)
|
||||
{
|
||||
if (print_function != NULL) {
|
||||
char msg[FIXED_BUFFER_SIZE] = { '\0' };
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int bh_printf(const char *message, ...);
|
||||
extern int bh_printf_sgx(const char *message, ...);
|
||||
|
||||
typedef uint64_t uint64;
|
||||
typedef int64_t int64;
|
||||
|
||||
@ -77,8 +77,6 @@ typedef void* (*thread_start_routine_t)(void*);
|
||||
#define wa_free bh_free
|
||||
#define wa_strdup bh_strdup
|
||||
|
||||
#define bh_printf printf
|
||||
|
||||
int snprintf(char *buffer, size_t count, const char *format, ...);
|
||||
double fmod(double x, double y);
|
||||
float fmodf(float x, float y);
|
||||
|
||||
@ -75,8 +75,6 @@ typedef void* (*thread_start_routine_t)(void*);
|
||||
#define wa_free bh_free
|
||||
#define wa_strdup bh_strdup
|
||||
|
||||
#define bh_printf printf
|
||||
|
||||
int snprintf(char *buffer, size_t count, const char *format, ...);
|
||||
double fmod(double x, double y);
|
||||
float fmodf(float x, float y);
|
||||
|
||||
@ -78,8 +78,6 @@ typedef void* (*thread_start_routine_t)(void*);
|
||||
#define wa_malloc bh_malloc
|
||||
#define wa_free bh_free
|
||||
|
||||
#define bh_printf printf
|
||||
|
||||
/* Unit test framework is based on C++, where the declaration of
|
||||
snprintf is different. */
|
||||
#ifndef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user