add macro function INI_STRING_IS_TRUE

pull/10/head
yuqing 2016-11-11 18:20:41 +08:00
parent 9f6022f9e8
commit cb3dc49e2a
2 changed files with 7 additions and 4 deletions

View File

@ -1605,10 +1605,7 @@ bool iniGetBoolValue(const char *szSectionName, const char *szItemName, \
}
else
{
return strcasecmp(pValue, "true") == 0 ||
strcasecmp(pValue, "yes") == 0 ||
strcasecmp(pValue, "on") == 0 ||
strcmp(pValue, "1") == 0;
return INI_STRING_IS_TRUE(pValue);
}
}

View File

@ -58,6 +58,12 @@ typedef struct
extern "C" {
#endif
#define INI_STRING_IS_TRUE(pValue) \
(strcasecmp(pValue, "true") == 0 || \
strcasecmp(pValue, "yes") == 0 || \
strcasecmp(pValue, "on") == 0 || \
strcmp(pValue, "1") == 0)
int iniSetAnnotationCallBack(AnnotationMap *map, int count);
void iniDestroyAnnotationCallBack();