Re-org shared lib header files, remove unused info (#136)
And fix compile issues of vxworks
This commit is contained in:
@ -14,13 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "bh_definition.h"
|
||||
#include "bh_platform.h"
|
||||
|
||||
int bh_return(int ret)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
#define RSIZE_MAX 0x7FFFFFFF
|
||||
|
||||
int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n)
|
||||
{
|
||||
@ -43,8 +39,9 @@ int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n)
|
||||
|
||||
int b_strcat_s(char * s1, size_t s1max, const char * s2)
|
||||
{
|
||||
if (NULL
|
||||
== s1|| NULL == s2 || s1max < (strlen(s1) + strlen(s2) + 1) || s1max > RSIZE_MAX) {
|
||||
if (NULL == s1 || NULL == s2
|
||||
|| s1max < (strlen(s1) + strlen(s2) + 1)
|
||||
|| s1max > RSIZE_MAX) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -55,8 +52,8 @@ int b_strcat_s(char * s1, size_t s1max, const char * s2)
|
||||
|
||||
int b_strcpy_s(char * s1, size_t s1max, const char * s2)
|
||||
{
|
||||
if (NULL
|
||||
== s1|| NULL == s2 || s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) {
|
||||
if (NULL == s1|| NULL == s2
|
||||
|| s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ bh_read_file_to_buffer(const char *filename, int *ret_size)
|
||||
|
||||
file_size = stat_buf.st_size;
|
||||
|
||||
if (!(buffer = wasm_malloc(file_size))) {
|
||||
if (!(buffer = bh_malloc(file_size))) {
|
||||
printf("Read file to buffer failed: alloc memory failed.\n");
|
||||
close(file);
|
||||
return NULL;
|
||||
@ -76,7 +76,7 @@ bh_read_file_to_buffer(const char *filename, int *ret_size)
|
||||
|
||||
if (read_size < file_size) {
|
||||
printf("Read file to buffer failed: read file content failed.\n");
|
||||
wasm_free(buffer);
|
||||
bh_free(buffer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,8 @@
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
|
||||
Reference in New Issue
Block a user