-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointers.h
More file actions
44 lines (33 loc) · 1006 Bytes
/
Copy pathpointers.h
File metadata and controls
44 lines (33 loc) · 1006 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
//
//
/////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __HAS_CPPMACROS_POINTERS_H__
#define __HAS_CPPMACROS_POINTERS_H__
/*! \file pointers.h
\brief Work with pointers
Depend from:
- /config.h
- /common/lang.h
- /common/versions.h
*/
#include "../config.h"
#include "../common/lang.h"
#include "../common/versions.h"
#ifdef __cplusplus
#ifdef CXX11
# define DELETE(pointer) PP_DO_SAFE(delete pointer ; pointer = NULL)
#else // CXX11
# define DELETE(pointer) PP_DO_SAFE(delete pointer ; pointer = nullptr)
#endif // CXX11
#else // !__cplusplus
#include <stdlib.h>
/*!
\brief Safe delete pointer and set pointer as NULL
\param pointer pointer, do not use expressions
\returns delete or free operator
*/
#define DELETE(pointer) PP_DO_SAFE(free( pointer ); pointer = NULL)
#endif // __cplusplus
/////////////////////////////////////////////////////////////////////////////
#endif // __HAS_CPPMACROS_POINTERS_H__