mirror of
https://github.com/openharmony/utils_native_lite.git
synced 2026-06-30 20:57:54 -04:00
iccarm工具链编译适配
Signed-off-by: i-wangliangliang <willfox@126.com> Change-Id: I8b9a1cf6caa805f944a2e7043cc5124c20f2989d
This commit is contained in:
@@ -73,11 +73,12 @@ int UtilsFileCopy(const char* src, const char* dest)
|
||||
return fpDest;
|
||||
}
|
||||
bool copyFailed = true;
|
||||
int nLen;
|
||||
char* dataBuf = (char *)malloc(BUFFER_SIZE);
|
||||
if (dataBuf == NULL) {
|
||||
goto MALLOC_ERROR;
|
||||
}
|
||||
int nLen = UtilsFileRead(fpSrc, dataBuf, BUFFER_SIZE);
|
||||
nLen = UtilsFileRead(fpSrc, dataBuf, BUFFER_SIZE);
|
||||
while (nLen > 0) {
|
||||
if (UtilsFileWrite(fpDest, dataBuf, nLen) != nLen) {
|
||||
goto EXIT;
|
||||
@@ -105,4 +106,4 @@ int UtilsFileMove(const char* src, const char* dest)
|
||||
ret = UtilsFileDelete(src);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@ lite_library("ace_kit_common") {
|
||||
target_type = "shared_library"
|
||||
}
|
||||
sources = [ "src/nativeapi_common.cpp" ]
|
||||
cflags = [ "-Wall" ]
|
||||
cflags_cc = cflags
|
||||
include_dirs = [
|
||||
"include",
|
||||
"//foundation/arkui/ace_engine_lite/interfaces/inner_api/builtin",
|
||||
|
||||
@@ -22,8 +22,6 @@ lite_library("ace_kit_deviceinfo") {
|
||||
target_type = "shared_library"
|
||||
}
|
||||
sources = [ "src/nativeapi_deviceinfo.cpp" ]
|
||||
cflags = [ "-Wall" ]
|
||||
cflags_cc = cflags
|
||||
|
||||
include_dirs = [
|
||||
"include",
|
||||
|
||||
@@ -130,12 +130,12 @@ bool NativeapiDeviceInfo::GetProductInfo(JSIValue result)
|
||||
}
|
||||
|
||||
Screen &screen = Screen::GetInstance();
|
||||
JSI::SetNumberProperty(result, "windowWidth", (double)screen.GetWidth());
|
||||
JSI::SetNumberProperty(result, "windowHeight", (double)screen.GetHeight());
|
||||
JSI::SetNumberProperty(result, "windowWidth", static_cast<double>(screen.GetWidth()));
|
||||
JSI::SetNumberProperty(result, "windowHeight", static_cast<double>(screen.GetHeight()));
|
||||
// set default value
|
||||
const uint8_t defaultScreenDensity = 195;
|
||||
const char * const defaultScreenShape = "rect";
|
||||
JSI::SetNumberProperty(result, "screenDensity", (double)defaultScreenDensity);
|
||||
JSI::SetNumberProperty(result, "screenDensity", static_cast<double>(defaultScreenDensity));
|
||||
JSI::SetStringProperty(result, "screenShape", defaultScreenShape);
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ lite_library("ace_kit_file") {
|
||||
"src/nativeapi_fs.cpp",
|
||||
"src/nativeapi_fs_impl.c",
|
||||
]
|
||||
cflags = [ "-Wall" ]
|
||||
cflags_cc = cflags
|
||||
|
||||
include_dirs = [
|
||||
"include",
|
||||
|
||||
@@ -352,7 +352,7 @@ void ExecuteReadTextFile(void* data)
|
||||
double position = JSI::GetNumberProperty(args, FILE_POSITION);
|
||||
double length = JSI::GetNumberProperty(args, FILE_LENGTH);
|
||||
JSIValue result = JSI::CreateObject();
|
||||
int ret = ReadTextInner(src, position, length, result);
|
||||
int ret = ReadTextInner(src, static_cast<int>(position), static_cast<int>(length), result);
|
||||
JSI::ReleaseString(src);
|
||||
if (ret == NATIVE_SUCCESS) {
|
||||
NativeapiCommon::SuccessCallBack(thisVal, args, result);
|
||||
|
||||
@@ -26,8 +26,6 @@ lite_library("ace_kit_kvstore") {
|
||||
"src/nativeapi_kv.cpp",
|
||||
"src/nativeapi_kv_impl.c",
|
||||
]
|
||||
cflags = [ "-Wall" ]
|
||||
cflags_cc = cflags
|
||||
|
||||
include_dirs = [
|
||||
"include",
|
||||
|
||||
@@ -23,8 +23,6 @@ ohos_static_library("ace_kit_common_simulator") {
|
||||
"//foundation/arkui/ace_engine_lite/interfaces/inner_api/builtin/base",
|
||||
]
|
||||
sources = [ "//utils/native/lite/js/builtin/common/src/nativeapi_common.cpp" ]
|
||||
cflags = [ "-Wall" ]
|
||||
cflags_cc = cflags
|
||||
}
|
||||
|
||||
ohos_static_library("ace_kit_deviceinfo_simulator") {
|
||||
@@ -38,8 +36,6 @@ ohos_static_library("ace_kit_deviceinfo_simulator") {
|
||||
sources = [
|
||||
"//utils/native/lite/js/builtin/deviceinfokit/src/nativeapi_deviceinfo.cpp",
|
||||
]
|
||||
cflags = [ "-Wall" ]
|
||||
cflags_cc = cflags
|
||||
deps = [
|
||||
"//foundation/arkui/ace_engine_lite/frameworks/targets/simulator:ace_lite",
|
||||
"//foundation/graphic/ui/huawei_proprietary/tools/ide:graphic_lite",
|
||||
|
||||
@@ -20,8 +20,6 @@ lite_library("kal_timer") {
|
||||
target_type = "shared_library"
|
||||
}
|
||||
sources = [ "src/kal.c" ]
|
||||
cflags = [ "-Wall" ]
|
||||
cflags_cc = cflags
|
||||
|
||||
include_dirs = [
|
||||
"include",
|
||||
|
||||
@@ -20,8 +20,6 @@ lite_library("ace_kit_timer") {
|
||||
target_type = "shared_library"
|
||||
}
|
||||
sources = [ "src/nativeapi_timer_task.c" ]
|
||||
cflags = [ "-Wall" ]
|
||||
cflags_cc = cflags
|
||||
|
||||
include_dirs = [
|
||||
"include",
|
||||
|
||||
Reference in New Issue
Block a user