36 lines
743 B
C++
36 lines
743 B
C++
#pragma once
|
|
|
|
#include "Win32Types.h"
|
|
#include <cassert>
|
|
#include <cmath>
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
#ifndef SAFE_DELETE
|
|
#define SAFE_DELETE(p) { if (p) { delete (p); (p) = nullptr; } }
|
|
#endif
|
|
|
|
#ifndef SAFE_DELETE_ARRAY
|
|
#define SAFE_DELETE_ARRAY(p) { if (p) { delete[] (p); (p) = nullptr; } }
|
|
#endif
|
|
|
|
#ifndef SAFE_RELEASE
|
|
#define SAFE_RELEASE(p) { if (p) { (p)->Release(); (p) = nullptr; } }
|
|
#endif
|
|
|
|
#ifndef IS_SET
|
|
#define IS_SET(flag,bit) ((flag) & (bit))
|
|
#endif
|
|
|
|
#ifndef SET_BIT
|
|
#define SET_BIT(var,bit) ((var) |= (bit))
|
|
#endif
|
|
|
|
#ifndef REMOVE_BIT
|
|
#define REMOVE_BIT(var,bit) ((var) &= ~(bit))
|
|
#endif
|
|
|
|
#ifndef TOGGLE_BIT
|
|
#define TOGGLE_BIT(var,bit) ((var) = (var) ^ (bit))
|
|
#endif
|