Skip to content

Instantly share code, notes, and snippets.

View armink's full-sized avatar

朱天龙 (Armink) armink

View GitHub Profile
@armink
armink / types_demo.c
Last active October 9, 2015 03:59
EasyFlash的types插件主要测试代码
#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)