-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWinArena.h
31 lines (23 loc) · 884 Bytes
/
WinArena.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/////////////////////////////////////////////////////////////////////////////
//
// $Header: /WinArena/WinArena.h 4 12/31/06 11:09a Lee $
//
// File: WinArena.h
//
//
/////////////////////////////////////////////////////////////////////////////
#pragma once
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <assert.h>
#include "Profiler.h"
#define SafeRelease(x) { if (NULL != (x)) { (x)->Release(); (x) = NULL; } }
#define SafeDelete(x) { if (NULL != (x)) { delete (x); (x) = NULL; } }
#define SafeDeleteArray(x) { if (NULL != (x)) { delete [] (x); (x) = NULL; } }
#define ArraySize(x) (sizeof(x) / (sizeof((x)[0])))
#define ClampRange(lo,v,hi) (((v) < (lo)) ? (lo) : (((v) > (hi)) ? (hi) : (v)))
template <class T> void Swap(T &a, T &b) { T temp; temp = a; a = b; b = temp; }