diff --git a/frameworks/js/ani/vibrator/src/vibrator_ani.cpp b/frameworks/js/ani/vibrator/src/vibrator_ani.cpp index 5ec7ef43ea41d95abd1d67f7167d0074dc8e9492..47870c33098854fe03690687479fb0e12832642a 100644 --- a/frameworks/js/ani/vibrator/src/vibrator_ani.cpp +++ b/frameworks/js/ani/vibrator/src/vibrator_ani.cpp @@ -22,6 +22,7 @@ #include #include "miscdevice_log.h" #include "vibrator_agent.h" +#include #undef LOG_TAG #define LOG_TAG "VibratorAni" @@ -212,7 +213,7 @@ static bool SetVibratePropertyInt64(ani_env* env, ani_object effect, const char* } propertyValue = static_cast(result); - MISC_HILOGD("\"%{public}s\": %{public}lld", propertyName, propertyValue); + MISC_HILOGD("\"%{public}s\": %{public}" PRId64, propertyName, propertyValue); return true; } @@ -242,7 +243,7 @@ static bool ParserParamFromVibrateFromFile(ani_env *env, ani_object effect, Vibr MISC_HILOGD("vibrateInfo.type: %{public}s, vibrateInfo.fd: %{public}d", typeStr.c_str(), vibrateInfo.fd); SetVibratePropertyInt64(env, static_cast(hapticFd), "offset", vibrateInfo.offset); - MISC_HILOGD("vibrateInfo.offset: %{public}lld", vibrateInfo.offset); + MISC_HILOGD("vibrateInfo.offset: %{public}" PRId64, vibrateInfo.offset); int64_t fdSize = GetFileSize(vibrateInfo.fd); if (!(vibrateInfo.offset >= 0) && (vibrateInfo.offset <= fdSize)) { MISC_HILOGE("The parameter of offset is invalid"); @@ -250,7 +251,7 @@ static bool ParserParamFromVibrateFromFile(ani_env *env, ani_object effect, Vibr } vibrateInfo.length = fdSize - vibrateInfo.offset; SetVibratePropertyInt64(env, static_cast(hapticFd), "length", vibrateInfo.length); - MISC_HILOGD("vibrateInfo.length: %{public}lld", vibrateInfo.length); + MISC_HILOGD("vibrateInfo.length: %{public}" PRId64, vibrateInfo.length); return true; }