diff --git a/frameworks/want_lite/src/want.cpp b/frameworks/want_lite/src/want.cpp index 2178ce79c9818cb4f2a1f0d1ae8d38573e48c386..daa4c5e4d7ca98c31b8210e5cff0ceb55c2fe5c4 100644 --- a/frameworks/want_lite/src/want.cpp +++ b/frameworks/want_lite/src/want.cpp @@ -58,6 +58,7 @@ constexpr uint8_t INT_VALUE_TYPE = 6; constexpr uint8_t STRING_VALUE_TYPE = 13; constexpr uint8_t KEY_VALUE_PAIR_TYPE = 97; + void ClearWant(Want *want) { if (want == nullptr) { @@ -471,4 +472,4 @@ const char *WantToUri(Want want) return uri; } -#endif +#endif \ No newline at end of file diff --git a/interfaces/kits/ability_lite/ability_loader.h b/interfaces/kits/ability_lite/ability_loader.h index e35e2236a5cef76b03e876b7db4f40bff3cf6c94..a46aa963be37ed3120e21ac584176073ea2f1993 100644 --- a/interfaces/kits/ability_lite/ability_loader.h +++ b/interfaces/kits/ability_lite/ability_loader.h @@ -111,11 +111,13 @@ private: * @param className Indicates the {@link Ability} class name to register. */ #define REGISTER_AA(className) \ + do{\ __attribute__((constructor)) void RegisterAA##className() { \ AbilityLoader::GetInstance().RegisterAbility(#className, []()->Ability* { \ return new className; \ }); \ - } + }\ + } while(0) /** * @brief Registers the class name of an {@link AbilitySlice} child class.