Upgrade WAMR-IDE (#1313)
Upgrade WAMR-IDE: test-tools/wamr-ide folder - add `wamr-sdk` to include libc-builtin-sysroot header files - add `prettier` check and apply script in `package.json` - update `wasm-toolchain` dockerfile and resource - enhance `build | run | debug` process to clean up the container - enhance the change workspace - enhance `wasm` type project check before building, running and debugging - format the project_compilation.json - update documents
This commit is contained in:
@ -7,26 +7,19 @@ project(Main)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/project.cmake)
|
||||
|
||||
set (CMAKE_SYSROOT /opt/wamr-sdk/app/libc-builtin-sysroot)
|
||||
|
||||
set (CMAKE_C_FLAGS " -nostdlib -g -Wno-unused-command-line-argument " CACHE INTERNAL "")
|
||||
|
||||
set (CMAKE_CXX_FLAGS " -nostdlib -g" CACHE INTERNAL "")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wno-unused-command-line-argument " CACHE INTERNAL "")
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -z stack-size=${STACK_SIZE}")
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdebug-prefix-map=/mnt='$ENV{PROJ_PATH}'")
|
||||
|
||||
set (CMAKE_EXE_LINKER_FLAGS
|
||||
"-Wl,--initial-memory=${INIT_MEM_SIZE},--max-memory=${MAX_MEM_SIZE}, \
|
||||
-Wl,--no-entry,")
|
||||
"${CMAKE_EXE_LINKER_FLAGS} -Wl,--initial-memory=${INIT_MEM_SIZE},--max-memory=${MAX_MEM_SIZE},")
|
||||
|
||||
set (CMAKE_EXE_LINKER_FLAGS
|
||||
"${CMAKE_EXE_LINKER_FLAGS} \
|
||||
${EXPORTED_SYMBOLS},")
|
||||
|
||||
set (CMAKE_EXE_LINKER_FLAGS
|
||||
"${CMAKE_EXE_LINKER_FLAGS} \
|
||||
-Wl,--allow-undefined-file=${CMAKE_SYSROOT}/share/defined-symbols.txt" CACHE INTERNAL "")
|
||||
|
||||
set (SRC_LIST
|
||||
${PROJECT_SRC_LIST})
|
||||
|
||||
@ -36,5 +29,4 @@ set (HEADER_LIST
|
||||
|
||||
include_directories(${HEADER_LIST})
|
||||
|
||||
add_executable (${OUTPUT_FILE_NAME} ${SRC_LIST})
|
||||
|
||||
add_executable (${OUTPUT_FILE_NAME} ${SRC_LIST})
|
||||
@ -1,14 +1,14 @@
|
||||
@REM Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
@REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
@echo off
|
||||
set target_name=%1
|
||||
|
||||
docker run -it --name=wasm-debug-server-ctr ^
|
||||
-v "%cd%":/mnt ^
|
||||
-p 1234:1234 ^
|
||||
wasm-debug-server:1.0 ^
|
||||
/bin/bash -c "./debug.sh %target_name%"
|
||||
|
||||
@REM stop and remove wasm-debug-server-container
|
||||
docker stop wasm-debug-server-ctr && docker rm wasm-debug-server-ctr
|
||||
@REM Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
@REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
@echo off
|
||||
|
||||
docker run -it --name=wasm-debug-server-ctr ^
|
||||
-v "%cd%":/mnt ^
|
||||
-p 1234:1234 ^
|
||||
wasm-debug-server:1.0 ^
|
||||
/bin/bash -c "./debug.sh %1"
|
||||
|
||||
@REM stop and remove wasm-debug-server-container
|
||||
docker stop wasm-debug-server-ctr>nul 2>nul
|
||||
docker rm wasm-debug-server-ctr>nul 2>nul
|
||||
9
test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.sh
Normal file → Executable file
9
test-tools/wamr-ide/VSCode-Extension/resource/scripts/boot_debugger_server.sh
Normal file → Executable file
@ -3,12 +3,11 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
target_name=$1
|
||||
|
||||
docker run -it --name=wasm-debug-server-ctr \
|
||||
-v $(pwd):/mnt \
|
||||
-v "$(pwd)":/mnt \
|
||||
-p 1234:1234 \
|
||||
wasm-debug-server:1.0 \
|
||||
/bin/bash -c "./debug.sh ${target_name}"
|
||||
/bin/bash -c "./debug.sh $1"
|
||||
|
||||
docker stop wasm-debug-server-ctr && docker rm wasm-debug-server-ctr
|
||||
docker stop wasm-debug-server-ctr>/dev/null
|
||||
docker rm wasm-debug-server-ctr>/dev/null
|
||||
@ -1,14 +1,15 @@
|
||||
@REM Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
@REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
@echo off
|
||||
set AoT_Binary_Name=%1
|
||||
|
||||
@REM start a container, mount current project path to container/mnt
|
||||
docker run --name=wasm-toolchain-provider-ctr ^
|
||||
-it -v %cd%:/mnt ^
|
||||
wasm-toolchain-provider:1.0 ^
|
||||
/bin/bash -c "./build_wasm.sh %AoT_Binary_Name%"
|
||||
|
||||
@REM stop and remove wasm-toolchain-ctr container
|
||||
docker stop wasm-toolchain-provider-ctr && docker rm wasm-toolchain-provider-ctr
|
||||
@REM Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
@REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
@echo off
|
||||
|
||||
@REM start a container, mount current project path to container/mnt
|
||||
docker run --name=wasm-toolchain-ctr ^
|
||||
-it -v "%cd%":/mnt ^
|
||||
--env=PROJ_PATH="%cd%" ^
|
||||
wasm-toolchain:1.0 ^
|
||||
/bin/bash -c "./build_wasm.sh %1"
|
||||
|
||||
@REM stop and remove wasm-toolchain-ctr container
|
||||
docker stop wasm-toolchain-ctr>nul 2>nul
|
||||
docker rm wasm-toolchain-ctr>nul 2>nul
|
||||
20
test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.sh
Normal file → Executable file
20
test-tools/wamr-ide/VSCode-Extension/resource/scripts/build.sh
Normal file → Executable file
@ -3,17 +3,11 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
AoT_Binary_Name=$1
|
||||
docker run --name=wasm-toolchain-ctr \
|
||||
-it -v "$(pwd)":/mnt \
|
||||
--env=PROJ_PATH="$(pwd)" \
|
||||
wasm-toolchain:1.0 \
|
||||
/bin/bash -c "./build_wasm.sh $1"
|
||||
|
||||
# start & run docker image and build wasm
|
||||
if test ! -z "$(docker ps -a | grep wasm-toolchain-ctr)"; then
|
||||
sudo docker rm wasm-toolchain-ctr
|
||||
fi
|
||||
|
||||
sudo docker run --name=wasm-toolchain-provider-ctr \
|
||||
-it -v $(pwd):/mnt \
|
||||
wasm-toolchain-provider:1.0 \
|
||||
/bin/bash -c "./build_wasm.sh $AoT_Binary_Name"
|
||||
|
||||
# stop and remove wasm-toolchain-ctr container
|
||||
sudo docker stop wasm-toolchain-provider-ctr && sudo docker rm wasm-toolchain-provider-ctr
|
||||
docker stop wasm-toolchain-ctr>/dev/null
|
||||
docker rm wasm-toolchain-ctr>/dev/null
|
||||
@ -0,0 +1,38 @@
|
||||
@REM Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
@REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
@echo off
|
||||
|
||||
call docker --version>nul 2>nul
|
||||
IF %ERRORLEVEL% GTR 0 (
|
||||
echo "Docker is not installed, please install docker desktop firstly."
|
||||
echo
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
call docker images>nul 2>nul
|
||||
IF %ERRORLEVEL% GTR 0 (
|
||||
echo "Docker is not ready, please lanuch docker desktop firstly."
|
||||
echo
|
||||
exit /b 2
|
||||
)
|
||||
|
||||
echo "Prepare to clean up the docker containers..."
|
||||
|
||||
call docker inspect wasm-toolchain-ctr>nul 2>nul
|
||||
IF %ERRORLEVEL% EQU 0 (
|
||||
echo "Stopping and removing wasm-toolchain-ctr container..."
|
||||
docker stop wasm-toolchain-ctr>nul 2>nul
|
||||
docker rm wasm-toolchain-ctr>nul 2>nul
|
||||
echo "Done."
|
||||
)
|
||||
|
||||
call docker inspect wasm-debug-server-ctr>nul 2>nul
|
||||
IF %ERRORLEVEL% EQU 0 (
|
||||
echo "Stopping and removing wasm-debug-server-ctr container..."
|
||||
docker stop wasm-debug-server-ctr>nul 2>nul
|
||||
docker rm wasm-debug-server-ctr>nul 2>nul
|
||||
echo "Done."
|
||||
)
|
||||
|
||||
echo "Clean up docker containers successfully."
|
||||
34
test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.sh
Executable file
34
test-tools/wamr-ide/VSCode-Extension/resource/scripts/destroy.sh
Executable file
@ -0,0 +1,34 @@
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
docker -v>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "\nDocker is not installed, please install docker firstly.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker images>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "\nDocker service is not running, please start your docker service firstly.\n"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Prepare to clean up the docker containers..."
|
||||
|
||||
if test ! -z "$(docker ps -a | grep wasm-toolchain-ctr)"; then
|
||||
echo "Stopping and removing wasm-toolchain-ctr container..."
|
||||
docker stop wasm-toolchain-ctr>/dev/null
|
||||
docker rm wasm-toolchain-ctr>/dev/null
|
||||
echo "Done."
|
||||
fi
|
||||
|
||||
if test ! -z "$(docker ps -a | grep wasm-debug-server-ctr)"; then
|
||||
echo "Stopping and removing wasm-debug-server-ctr container..."
|
||||
docker stop wasm-debug-server-ctr>/dev/null
|
||||
docker rm wasm-debug-server-ctr>/dev/null
|
||||
echo "Done."
|
||||
fi
|
||||
|
||||
echo "Clean up docker containers successfully."
|
||||
@ -1,17 +1,17 @@
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
set (OUTPUT_FILE_NAME)
|
||||
|
||||
set (INIT_MEM_SIZE)
|
||||
|
||||
set (MAX_MEM_SIZE)
|
||||
|
||||
set (STACK_SIZE)
|
||||
|
||||
set (EXPORTED_SYMBOLS)
|
||||
|
||||
set (PROJECT_SRC_LIST)
|
||||
|
||||
set (PROJECT_INCLUDES)
|
||||
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
set (OUTPUT_FILE_NAME)
|
||||
|
||||
set (INIT_MEM_SIZE)
|
||||
|
||||
set (MAX_MEM_SIZE)
|
||||
|
||||
set (STACK_SIZE)
|
||||
|
||||
set (EXPORTED_SYMBOLS)
|
||||
|
||||
set (PROJECT_SRC_LIST)
|
||||
|
||||
set (PROJECT_INCLUDES)
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
@REM Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
@REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
@echo off
|
||||
set target_name=%1
|
||||
|
||||
docker run -it --name=wasm-executor-ctr ^
|
||||
-v "%cd%":/mnt ^
|
||||
wasm-debug-server:1.0 ^
|
||||
/bin/bash -c "./run.sh %target_name%"
|
||||
|
||||
@REM stop and remove wasm-executor-ctr
|
||||
docker stop wasm-executor-ctr && docker rm wasm-executor-ctr
|
||||
@REM Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
@REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
@echo off
|
||||
|
||||
docker run -it --name=wasm-debug-server-ctr ^
|
||||
-v "%cd%":/mnt ^
|
||||
wasm-debug-server:1.0 ^
|
||||
/bin/bash -c "./run.sh %1"
|
||||
|
||||
@REM stop and remove wasm-debug-server-ctr
|
||||
docker stop wasm-debug-server-ctr>nul 2>nul
|
||||
docker rm wasm-debug-server-ctr>nul 2>nul
|
||||
8
test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.sh
Normal file → Executable file
8
test-tools/wamr-ide/VSCode-Extension/resource/scripts/run.sh
Normal file → Executable file
@ -2,11 +2,11 @@
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#!/bin/bash
|
||||
target_name=$1
|
||||
|
||||
docker run -it --name=wasm-debug-server-ctr \
|
||||
-v $(pwd):/mnt \
|
||||
-v "$(pwd)":/mnt \
|
||||
wasm-debug-server:1.0 \
|
||||
/bin/bash -c "./run.sh ${target_name}"
|
||||
/bin/bash -c "./run.sh $1"
|
||||
|
||||
docker stop wasm-debug-server-ctr && docker rm wasm-debug-server-ctr
|
||||
docker stop wasm-debug-server-ctr>/dev/null
|
||||
docker rm wasm-debug-server-ctr>/dev/null
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_ASSERT_H
|
||||
#define _WAMR_LIBC_ASSERT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_CTYPE_H
|
||||
#define _WAMR_LIBC_CTYPE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int
|
||||
isupper(int c);
|
||||
int
|
||||
isalpha(int c);
|
||||
int
|
||||
isspace(int c);
|
||||
int
|
||||
isgraph(int c);
|
||||
int
|
||||
isprint(int c);
|
||||
int
|
||||
isdigit(int c);
|
||||
int
|
||||
isxdigit(int c);
|
||||
int
|
||||
tolower(int c);
|
||||
int
|
||||
toupper(int c);
|
||||
int
|
||||
isalnum(int c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_ERRNO_H
|
||||
#define _WAMR_LIBC_ERRNO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_FCNTL_H
|
||||
#define _WAMR_LIBC_FCNTL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_INTTYPES_H
|
||||
#define _WAMR_LIBC_INTTYPES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_LIMITS_H
|
||||
#define _WAMR_LIBC_LIMITS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define CHAR_BIT 8
|
||||
#define SCHAR_MIN -128
|
||||
#define SCHAR_MAX 127
|
||||
#define UCHAR_MAX 255
|
||||
#define CHAR_MIN 0
|
||||
#define CHAR_MAX 127
|
||||
#define MB_LEN_MAX 1
|
||||
#define SHRT_MIN -32768
|
||||
#define SHRT_MAX +32767
|
||||
#define USHRT_MAX 65535
|
||||
#define INT_MIN -32768
|
||||
#define INT_MAX +32767
|
||||
#define UINT_MAX 65535
|
||||
#define LONG_MIN -2147483648
|
||||
#define LONG_MAX +2147483647
|
||||
#define ULONG_MAX 4294967295
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIB_PTHREAD_H
|
||||
#define _WAMR_LIB_PTHREAD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Data type define of pthread, mutex, cond and key */
|
||||
typedef unsigned int pthread_t;
|
||||
typedef unsigned int pthread_mutex_t;
|
||||
typedef unsigned int pthread_cond_t;
|
||||
typedef unsigned int pthread_key_t;
|
||||
|
||||
/* Thread APIs */
|
||||
int
|
||||
pthread_create(pthread_t *thread, const void *attr,
|
||||
void *(*start_routine)(void *), void *arg);
|
||||
|
||||
int
|
||||
pthread_join(pthread_t thread, void **retval);
|
||||
|
||||
int
|
||||
pthread_detach(pthread_t thread);
|
||||
|
||||
int
|
||||
pthread_cancel(pthread_t thread);
|
||||
|
||||
pthread_t
|
||||
pthread_self(void);
|
||||
|
||||
void
|
||||
pthread_exit(void *retval);
|
||||
|
||||
/* Mutex APIs */
|
||||
int
|
||||
pthread_mutex_init(pthread_mutex_t *mutex, const void *attr);
|
||||
|
||||
int
|
||||
pthread_mutex_lock(pthread_mutex_t *mutex);
|
||||
|
||||
int
|
||||
pthread_mutex_unlock(pthread_mutex_t *mutex);
|
||||
|
||||
int
|
||||
pthread_mutex_destroy(pthread_mutex_t *mutex);
|
||||
|
||||
/* Cond APIs */
|
||||
int
|
||||
pthread_cond_init(pthread_cond_t *cond, const void *attr);
|
||||
|
||||
int
|
||||
pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
|
||||
|
||||
int
|
||||
pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
uint64_t useconds);
|
||||
|
||||
int
|
||||
pthread_cond_signal(pthread_cond_t *cond);
|
||||
|
||||
int
|
||||
pthread_cond_broadcast(pthread_cond_t *cond);
|
||||
|
||||
int
|
||||
pthread_cond_destroy(pthread_cond_t *cond);
|
||||
|
||||
/* Pthread key APIs */
|
||||
int
|
||||
pthread_key_create(pthread_key_t *key, void (*destructor)(void *));
|
||||
|
||||
int
|
||||
pthread_setspecific(pthread_key_t key, const void *value);
|
||||
|
||||
void *
|
||||
pthread_getspecific(pthread_key_t key);
|
||||
|
||||
int
|
||||
pthread_key_delete(pthread_key_t key);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* end of _WAMR_LIB_PTHREAD_H */
|
||||
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_STDARG_H
|
||||
#define _WAMR_LIBC_STDARG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _VA_LIST
|
||||
typedef __builtin_va_list va_list;
|
||||
#define _VA_LIST
|
||||
#endif
|
||||
#define va_start(ap, param) __builtin_va_start(ap, param)
|
||||
#define va_end(ap) __builtin_va_end(ap)
|
||||
#define va_arg(ap, type) __builtin_va_arg(ap, type)
|
||||
|
||||
#define __va_copy(d, s) __builtin_va_copy(d, s)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* end of _WAMR_LIBC_STDARG_H */
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_STDBOOL_H
|
||||
#define _WAMR_LIBC_STDBOOL_H
|
||||
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#define bool _Bool
|
||||
#define false 0
|
||||
#define true 1
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_STDINT_H
|
||||
#define _WAMR_LIBC_STDINT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* clang-format off */
|
||||
typedef char int8_t;
|
||||
typedef short int int16_t;
|
||||
typedef int int32_t;
|
||||
typedef long long int int64_t;
|
||||
|
||||
/* Unsigned. */
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short int uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
|
||||
typedef __INTPTR_TYPE__ intptr_t;
|
||||
typedef __UINTPTR_TYPE__ uintptr_t;
|
||||
|
||||
/* Minimum of signed integral types. */
|
||||
# define INT8_MIN (-128)
|
||||
# define INT16_MIN (-32767-1)
|
||||
# define INT32_MIN (-2147483647-1)
|
||||
# define INT64_MIN (-__INT64_C(9223372036854775807)-1)
|
||||
/* Maximum of signed integral types. */
|
||||
# define INT8_MAX (127)
|
||||
# define INT16_MAX (32767)
|
||||
# define INT32_MAX (2147483647)
|
||||
# define INT64_MAX (__INT64_C(9223372036854775807))
|
||||
|
||||
/* Maximum of unsigned integral types. */
|
||||
# define UINT8_MAX (255)
|
||||
# define UINT16_MAX (65535)
|
||||
# define UINT32_MAX (4294967295U)
|
||||
# define UINT64_MAX (__UINT64_C(18446744073709551615))
|
||||
/* clang-format on */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_STDIO_H
|
||||
#define _WAMR_LIBC_STDIO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
|
||||
typedef unsigned long size_t;
|
||||
|
||||
int
|
||||
printf(const char *format, ...);
|
||||
int
|
||||
putchar(int c);
|
||||
int
|
||||
snprintf(char *str, size_t size, const char *format, ...);
|
||||
int
|
||||
sprintf(char *str, const char *format, ...);
|
||||
int
|
||||
puts(char *string);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_STDLIB_H
|
||||
#define _WAMR_LIBC_STDLIB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef unsigned long size_t;
|
||||
|
||||
int
|
||||
atoi(const char *s);
|
||||
void
|
||||
exit(int status);
|
||||
long
|
||||
strtol(const char *nptr, char **endptr, register int base);
|
||||
unsigned long
|
||||
strtoul(const char *nptr, char **endptr, register int base);
|
||||
void *
|
||||
malloc(size_t size);
|
||||
void *
|
||||
calloc(size_t n, size_t size);
|
||||
void
|
||||
free(void *ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_STRING_H
|
||||
#define _WAMR_LIBC_STRING_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef unsigned long size_t;
|
||||
|
||||
int
|
||||
memcmp(const void *s1, const void *s2, size_t n);
|
||||
void *
|
||||
memcpy(void *dest, const void *src, size_t n);
|
||||
void *
|
||||
memmove(void *dest, const void *src, size_t n);
|
||||
void *
|
||||
memset(void *s, int c, size_t n);
|
||||
void *
|
||||
memchr(const void *s, int c, size_t n);
|
||||
int
|
||||
strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
size_t
|
||||
strspn(const char *s, const char *accept);
|
||||
size_t
|
||||
strcspn(const char *s, const char *reject);
|
||||
char *
|
||||
strstr(const char *s, const char *find);
|
||||
char *
|
||||
strchr(const char *s, int c);
|
||||
int
|
||||
strcmp(const char *s1, const char *s2);
|
||||
char *
|
||||
strcpy(char *dest, const char *src);
|
||||
size_t
|
||||
strlen(const char *s);
|
||||
int
|
||||
strncmp(const char *str1, const char *str2, size_t n);
|
||||
char *
|
||||
strncpy(char *dest, const char *src, unsigned long n);
|
||||
char *
|
||||
strdup(const char *s);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef _WAMR_LIBC_STRINGS_H
|
||||
#define _WAMR_LIBC_STRINGS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user