diff --git a/frameworks/config_policy/src/config_policy_utils.c b/frameworks/config_policy/src/config_policy_utils.c index 6f14f82b0c805eba745c4f62005382d333382c4a..8c1048634ccf264d6e32203e2233f72bd94a5c00 100644 --- a/frameworks/config_policy/src/config_policy_utils.c +++ b/frameworks/config_policy/src/config_policy_utils.c @@ -27,6 +27,8 @@ #endif static const size_t MIN_APPEND_LEN = 32; + +#ifndef __LITEOS__ // set min opkey length static const unsigned int MIN_OPKEY_LEN = 3; // ':' split different x rules, example:":relPath,mode[,extra][:]" @@ -42,6 +44,7 @@ typedef struct { size_t strLen; // strlen(p), less than size char *p; // just init to NULL, by malloc } StringHolder; +#endif typedef struct { int segCount; // count of char * in segs @@ -140,7 +143,6 @@ static char *GetOpkeyPath(int type) FreeIf(result); return NULL; } -#endif // __LITEOS__ static SplitedStr *SplitStr(char *str, char delim) { @@ -163,6 +165,7 @@ static SplitedStr *SplitStr(char *str, char delim) } return result; } +#endif // __LITEOS__ static void FreeSplitedStr(SplitedStr *p) { @@ -261,12 +264,6 @@ static SplitedStr *GetFollowXPathByMode(const char *relPath, int followMode, con SplitedStr *result = expandVal ? SplitStr(expandVal, ',') : NULL; return result; } -#else -static SplitedStr *GetFollowXPathByMode(const char *relPath, int followMode, const char *extra) -{ - return NULL; -} -#endif static char *TrimInplace(char *str, bool moveToStart) { @@ -374,6 +371,12 @@ static char *ExpandStr(char *src, const char *def, QueryFunc queryFunc) } return sh.p; } +#else +static SplitedStr *GetFollowXPathByMode(const char *relPath, int followMode, const char *extra) +{ + return NULL; +} +#endif static void GetCfgDirRealPolicyValue(CfgDir *res) {