lib/accessor.h
changeset 884 a51a3bb4d613
parent 881 e05d69c1ccb3
equal deleted inserted replaced
883:f1b501f47c1f 884:a51a3bb4d613
    19 		return &((*GLOBAL__##name).value);\
    19 		return &((*GLOBAL__##name).value);\
    20 	}
    20 	}
    21 #define __DECLARE_GLOBAL_FB(type, domain, name)\
    21 #define __DECLARE_GLOBAL_FB(type, domain, name)\
    22 	type domain##__##name;\
    22 	type domain##__##name;\
    23 	static type *GLOBAL__##name = &(domain##__##name);\
    23 	static type *GLOBAL__##name = &(domain##__##name);\
    24 	type* __GET_GLOBAL_##name(void) {\
    24 	static type* __GET_GLOBAL_##name(void) {\
    25 		return &(*GLOBAL__##name);\
    25 		return &(*GLOBAL__##name);\
    26 	}\
    26 	}\
    27 	extern void type##_init__(type* data__, BOOL retain);
    27 	/*extern void type##_init__(type* data__, BOOL retain)*/;
    28 #define __DECLARE_GLOBAL_LOCATION(type, location)\
    28 #define __DECLARE_GLOBAL_LOCATION(type, location)\
    29 	extern type *location;
    29 	extern type *location;
    30 #define __DECLARE_GLOBAL_LOCATED(type, resource, name)\
    30 #define __DECLARE_GLOBAL_LOCATED(type, resource, name)\
    31 	__IEC_##type##_p resource##__##name;\
    31 	__IEC_##type##_p resource##__##name;\
    32 	static __IEC_##type##_p *GLOBAL__##name = &(resource##__##name);\
    32 	static __IEC_##type##_p *GLOBAL__##name = &(resource##__##name);\
    66 #define __INIT_GLOBAL_LOCATED(domain, name, location, retained)\
    66 #define __INIT_GLOBAL_LOCATED(domain, name, location, retained)\
    67 	domain##__##name.value = location;\
    67 	domain##__##name.value = location;\
    68 	__INIT_RETAIN(domain##__##name, retained)
    68 	__INIT_RETAIN(domain##__##name, retained)
    69 #define __INIT_EXTERNAL(type, global, name, retained)\
    69 #define __INIT_EXTERNAL(type, global, name, retained)\
    70     {\
    70     {\
       
    71         type* __GET_GLOBAL_##global();\
    71 		name.value = __GET_GLOBAL_##global();\
    72 		name.value = __GET_GLOBAL_##global();\
    72 		__INIT_RETAIN(name, retained)\
    73 		__INIT_RETAIN(name, retained)\
    73     }
    74     }
    74 #define __INIT_EXTERNAL_FB(type, global, name, retained)\
    75 #define __INIT_EXTERNAL_FB(type, global, name, retained)\
    75 	name = __GET_GLOBAL_##global();
    76 	name = __GET_GLOBAL_##global();