This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define EF_ENV_TYPES_BASIC_TYPES_CHECK(type) \ | |
EF_ASSERT(!strcmp(#type, "int") || !strcmp(#type, "double") || !strcmp(#type, "string")); | |
/* 1. 获取结构体 */ | |
/* 1.1 基本类型 */ | |
#define EF_ENV_TYPES_STRUCT_GET_int_ELEMENT(to_struct, from_json, _element) \ | |
if (json_temp = cJSON_GetObjectItem(from_json, #_element)) (to_struct)->_element = json_temp->valueint; | |
#define EF_ENV_TYPES_STRUCT_GET_string_ELEMENT(to_struct, from_json, _element) \ | |
if (json_temp = cJSON_GetObjectItem(from_json, #_element)) strcpy((to_struct)->_element, json_temp->valuestring) |
NewerOlder