Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _KIT_W32_PRIVMACRO_H
- #define _KIT_W32_PRIVMACRO_H
- //relies on label "_error_" and integer value "returnStatus"
- #if !defined(_IS_ERROR)
- # define _IS_ERROR(_value,_before_goto) \
- { returnStatus=_value; _before_goto; goto _error_; }
- #endif /* _IS_ERROR */
- #if !defined(_IF_ERROR)
- # define _IF_ERROR(_condition,_value,_before_goto) \
- if(_condition) _IS_ERROR(_value,_before_goto);
- #endif /* _IF_ERROR */
- //relies on label "_error_"
- #if !defined(_IF_GOTO)
- # define _IF_GOTO(_condition,_label,_before_goto) \
- if(_condition){ _before_goto; goto _label; }
- #endif /* _IF_GOTO */
- #if !defined(_IF_GOTO_ERROR)
- # define _IF_GOTO_ERROR(_condition,_before_goto) \
- _IF_GOTO(_condition,_error_,_before_goto)
- #endif /* _IF_GOTO_ERROR */
- //relies on ULONG variable "numRefs" (value initialized to 1)
- #if !defined(_KIT_COM_RELEASE)
- # define _KIT_COM_RELEASE(_object) \
- while(numRefs){ numRefs=_object->Release(); } \
- numRefs=1;
- #endif /* _KIT_COM_RELEASE */
- #if !defined(_KIT_COM_RELEASE_S)
- # define _KIT_COM_RELEASE_S(_object) \
- if(_object != NULL){ _KIT_COM_RELEASE(_object) }
- #endif /* _KIT_COM_RELEASE_S */
- #if !defined(_KIT_COM_CALL)
- # define _KIT_COM_CALL(_object,_method) \
- _object->_method();
- #endif /* _KIT_COM_CALL */
- #if !defined(_KIT_COM_CALL_S)
- # define _KIT_COM_CALL_S(_object,_method) \
- if(_object != NULL){ _KIT_COM_CALL(_object,_method) }
- #endif /* _KIT_COM_CALL_S */
- #if !defined(_KIT_COM_CALLEQ_S)
- # define _KIT_COM_CALLEQ_S(_var,_object,_method) \
- if(_object != NULL){ _var=_KIT_COM_CALL(_object,_method) }
- #endif /* _KIT_COM_CALLEQ_S */
- #endif /* _KIT_W32_PRIVMACRO_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement