vrecko
virtual reality framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
HelperMacros.h
Go to the documentation of this file.
1
#ifndef HELPER_MACROS_H
2
#define HELPER_MACROS_H
3
4
#include <
vrecko/Logger.h
>
5
6
// Macros for error handling:
7
//
8
9
#define BFAILGOTO(Function) { if (!(Function)) { OUTPUTSTR3("\n%s(%d): An error occured!", __FILE__, __LINE__); goto FuncFailed; } }
10
#define BFAILGOTO_TEXT(Function, TextFunc) { if (!(Function)) { { OUTPUTSTR3("\n%s(%d): Following error occured:", __FILE__, __LINE__); TextFunc; } goto FuncFailed; } }
11
#define BFAILRET(Function) { if (!(Function)) { OUTPUTSTR3("\n%s(%d): An error occured!", __FILE__, __LINE__); return false; } }
12
#define BFAILRET_TEXT(Function, TextFunc) { if (!(Function)) { { OUTPUTSTR3("\n%s(%d): Following error occured:", __FILE__, __LINE__); TextFunc; } return false; } }
13
14
15
#ifndef SAFE_DELETE
16
#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
17
#endif
18
19
#ifndef SAFE_FREE
20
#define SAFE_FREE(p) { if(p) { free (p); (p)=NULL; } }
21
#endif
22
23
24
#endif
include
helpers
HelperMacros.h
Generated on Tue Feb 19 2013 10:23:41 for vrecko by
1.8.3.1