Re-org shared lib header files, remove unused info (#136)
And fix compile issues of vxworks
This commit is contained in:
@ -39,37 +39,31 @@ extern "C" {
|
||||
|
||||
#ifdef BH_DEBUG
|
||||
|
||||
extern void bh_assert_internal(int v, const char *file_name, int line_number, const char *expr_string);
|
||||
#define bh_assert(expr) bh_assert_internal((int)(expr), __FILE__, __LINE__, # expr)
|
||||
extern void bh_debug_internal(const char *file_name, int line_number, const char *fmt, ...);
|
||||
void bh_assert_internal(int v, const char *file_name, int line_number,
|
||||
const char *expr_string);
|
||||
#define bh_assert(expr) bh_assert_internal((int)(expr), __FILE__, __LINE__, #expr)
|
||||
|
||||
#if defined(WIN32) || defined(EMU)
|
||||
# define bh_debug(fmt, ...) bh_debug_internal(__FILE__, __LINE__, fmt, __VA_ARGS__)
|
||||
void bh_debug_internal(const char *file_name, int line_number,
|
||||
const char *fmt, ...);
|
||||
#if defined(WIN32)
|
||||
#define bh_debug(fmt, ...) bh_debug_internal(__FILE__, __LINE__, fmt, __VA_ARGS__)
|
||||
#elif defined(__linux__)
|
||||
/*# define bh_debug(...) bh_debug_internal(__FILE__, __LINE__, ## __VA_ARGS__)*/
|
||||
# define bh_debug bh_debug_internal(__FILE__, __LINE__, "");printf
|
||||
#elif defined(PLATFORM_SEC)
|
||||
# define bh_debug(fmt, ...) bh_debug_internal(__FILE__, __LINE__, fmt, __VA_ARGS__)
|
||||
#define bh_debug bh_debug_internal(__FILE__, __LINE__, "");printf
|
||||
#else
|
||||
# error "Unsupported platform"
|
||||
#error "Unsupported platform"
|
||||
#endif
|
||||
|
||||
#else
|
||||
#else /* else of BH_DEBUG */
|
||||
|
||||
#define bh_debug if(0)printf
|
||||
|
||||
#endif
|
||||
|
||||
#define bh_assert_abort(x) do { \
|
||||
if (!x) \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#endif /* end of BH_DEBUG */
|
||||
|
||||
#ifdef BH_TEST
|
||||
# define BH_STATIC
|
||||
#define BH_STATIC
|
||||
#else
|
||||
# define BH_STATIC static
|
||||
#endif
|
||||
#define BH_STATIC static
|
||||
#endif /* end of BH_TEST */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@ -77,8 +71,3 @@ extern void bh_debug_internal(const char *file_name, int line_number, const char
|
||||
|
||||
#endif
|
||||
|
||||
/* Local Variables: */
|
||||
/* mode:c */
|
||||
/* c-basic-offset: 4 */
|
||||
/* indent-tabs-mode: nil */
|
||||
/* End: */
|
||||
|
||||
@ -38,7 +38,7 @@ extern "C" {
|
||||
* vm_thread_sys_init
|
||||
* initiation function for beihai thread system. Invoked at the beginning of beihai intiation.
|
||||
*
|
||||
* @return BH_SUCCESS if succuess.
|
||||
* @return 0 if succuess.
|
||||
*/
|
||||
int _vm_thread_sys_init(void);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -58,7 +58,7 @@ void vm_thread_sys_destroy(void);
|
||||
* @param arg argument passed to main routine
|
||||
* @param stack_size bytes of stack size
|
||||
*
|
||||
* @return BH_SUCCESS if success.
|
||||
* @return 0 if success.
|
||||
*/
|
||||
int _vm_thread_create(korp_tid *p_tid, thread_start_routine_t start, void *arg,
|
||||
unsigned int stack_size);
|
||||
@ -78,7 +78,7 @@ int vm_thread_create_instr(korp_tid *p_tid, thread_start_routine_t start, void *
|
||||
* @param stack_size bytes of stack size
|
||||
* @param prio the priority
|
||||
*
|
||||
* @return BH_SUCCESS if success.
|
||||
* @return 0 if success.
|
||||
*/
|
||||
int _vm_thread_create_with_prio(korp_tid *p_tid, thread_start_routine_t start,
|
||||
void *arg, unsigned int stack_size, int prio);
|
||||
@ -115,7 +115,7 @@ korp_tid vm_self_thread_instr(const char*func_name);
|
||||
* @param idx tls array index
|
||||
* @param ptr pointer need save as TLS
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_tls_put(unsigned idx, void *ptr);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -147,7 +147,7 @@ void *vm_tls_get_instr(unsigned idx, const char*func_name);
|
||||
*
|
||||
* @param mutex [OUTPUT] pointer to mutex initialized.
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_mutex_init(korp_mutex *mutex);
|
||||
#ifdef INSTRUMENT_TEST_ENABLED
|
||||
@ -162,7 +162,7 @@ int vm_mutex_init_instr(korp_mutex *mutex, const char*func_name);
|
||||
*
|
||||
* @param mutex [OUTPUT] pointer to mutex initialized.
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_recursive_mutex_init(korp_mutex *mutex);
|
||||
#ifdef INSTRUMENT_TEST_ENABLED
|
||||
@ -177,7 +177,7 @@ int vm_recursive_mutex_init_instr(korp_mutex *mutex, const char*func_name);
|
||||
*
|
||||
* @param mutex pointer to mutex need destroy
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_mutex_destroy(korp_mutex *mutex);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -201,7 +201,7 @@ void vm_mutex_lock(korp_mutex *mutex);
|
||||
*
|
||||
* @param mutex pointer to mutex need lock
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int vm_mutex_trylock(korp_mutex *mutex);
|
||||
|
||||
@ -220,7 +220,7 @@ void vm_mutex_unlock(korp_mutex *mutex);
|
||||
* @param sem [OUTPUT] pointer to semaphone
|
||||
* @param c counter of semaphone
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_sem_init(korp_sem *sem, unsigned int c);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -235,7 +235,7 @@ int vm_sem_init_instr(korp_sem *sem, unsigned int c, const char*func_name);
|
||||
*
|
||||
* @param sem pointer to semaphone need destroy
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_sem_destroy(korp_sem *sem);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -250,7 +250,7 @@ int vm_sem_destroy_instr(korp_sem *sem, const char*func_name);
|
||||
*
|
||||
* @param sem pointer to semaphone need perform wait operation
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_sem_wait(korp_sem *sem);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -266,7 +266,7 @@ int vm_sem_wait_instr(korp_sem *sem, const char*func_name);
|
||||
* @param sem pointer to semaphone need perform wait operation
|
||||
* @param mills wait milliseconds to return
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
* @return BH_TIMEOUT if time out
|
||||
*/
|
||||
int _vm_sem_reltimedwait(korp_sem *sem, int mills);
|
||||
@ -282,7 +282,7 @@ int vm_sem_reltimedwait_instr(korp_sem *sem, int mills, const char*func_name);
|
||||
*
|
||||
* @param sem pointer to semaphone need perform post operation
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_sem_post(korp_sem *sem);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -297,7 +297,7 @@ int vm_sem_post_instr(korp_sem *sem, const char*func_name);
|
||||
*
|
||||
* @param cond [OUTPUT] pointer to condition variable
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_cond_init(korp_cond *cond);
|
||||
#ifdef INSTRUMENT_TEST_ENABLED
|
||||
@ -312,7 +312,7 @@ int vm_cond_init_instr(korp_cond *cond, const char*func_name);
|
||||
*
|
||||
* @param cond pointer to condition variable
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_cond_destroy(korp_cond *cond);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -328,7 +328,7 @@ int vm_cond_destroy_instr(korp_cond *cond, const char*func_name);
|
||||
* @param cond pointer to condition variable
|
||||
* @param mutex pointer to mutex to protect the condition variable
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_cond_wait(korp_cond *cond, korp_mutex *mutex);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -345,7 +345,7 @@ int vm_cond_wait_instr(korp_cond *cond, korp_mutex *mutex, const char*func_name)
|
||||
* @param mutex pointer to mutex to protect the condition variable
|
||||
* @param mills milliseconds to wait
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_cond_reltimedwait(korp_cond *cond, korp_mutex *mutex, int mills);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
@ -360,7 +360,7 @@ int vm_cond_reltimedwait_instr(korp_cond *cond, korp_mutex *mutex, int mills, co
|
||||
*
|
||||
* @param cond condition variable
|
||||
*
|
||||
* @return BH_SUCCESS if success
|
||||
* @return 0 if success
|
||||
*/
|
||||
int _vm_cond_signal(korp_cond *cond);
|
||||
#ifdef _INSTRUMENT_TEST_ENABLED
|
||||
|
||||
@ -22,7 +22,6 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include "bh_config.h"
|
||||
#include "bh_definition.h"
|
||||
#include "bh_types.h"
|
||||
#include "bh_platform.h"
|
||||
|
||||
|
||||
@ -28,25 +28,16 @@ typedef int int32;
|
||||
typedef float float32;
|
||||
typedef double float64;
|
||||
|
||||
#define BYTES_OF_UINT8 1
|
||||
#define BYTES_OF_UINT16 2
|
||||
#define BYTES_OF_UINT32 4
|
||||
#define BYTES_OF_UINT64 8
|
||||
|
||||
#define BYTES_OF_BOOLEAN 1
|
||||
#define BYTES_OF_BYTE 1
|
||||
#define BYTES_OF_CHAR 2
|
||||
#define BYTES_OF_SHORT 2
|
||||
#define BYTES_OF_INT 4
|
||||
#define BYTES_OF_FLOAT 4
|
||||
#define BYTES_OF_LONG 8
|
||||
#define BYTES_OF_DOUBLE 8
|
||||
|
||||
#include "bh_platform.h"
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void*)0
|
||||
#endif
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define true 1
|
||||
#define false 0
|
||||
#define inline __inline
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user