AxibugEmuOnline/References/virtuanessrc097-master/Macro.h
2024-08-05 17:58:53 +08:00

24 lines
1.3 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// 便利かも知れないマクロたち
//
#ifndef __MACRO_INCLUDED__
#define __MACRO_INCLUDED__
// 多重呼び出し対応マクロちゃん
#define DELETEPTR(x) if(x) { delete x; x = NULL; }
#define DELETEARR(x) if(x) { delete[] x; x = NULL; }
#define RELEASE(x) if(x) { x->Release(); x=NULL; }
#define FREE(x) if(x) { free(x); x=NULL; }
#define FCLOSE(x) if(x) { fclose(x); x=NULL; }
#define GDIDELETE(x) if(x) { ::DeleteObject(x); x=NULL; }
#define CLOSEHANDLE(x) if(x) { ::CloseHandle(x); x = NULL; }
// その他
#define ZEROMEMORY(p,s) ::memset( (p), 0, (s) )
// RECT構造体用
#define RCWIDTH(rc) ((rc).right-(rc).left)
#define RCHEIGHT(rc) ((rc).bottom-(rc).top)
#endif // !__MACRO_INCLUDED__