Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6uefidefs.h
Go to the documentation of this file.
1 #ifndef UEFIDEFS_H__
2 #define UEFIDEFS_H__ 1
3 
4 #include "p6err.h"
5 
6 #ifdef P6_UEFI
7 #define P6_DECL_UEFI_ALLOCATOR \
8  void* operator new(size_t size,const std::nothrow_t& tag); \
9  void* operator new[](size_t count,const std::nothrow_t& tag); \
10  void operator delete(void *pMem)
11 
20 #define P6_IMPLEMENT_UEFI_ALLOCATOR(classname) \
21 void* classname::operator new(size_t size,const std::nothrow_t& tag) \
22 { \
23  void *pMem = NULL; \
24  P6UNUSED(tag); \
25  p6AllocMemory(size,&pMem); \
26  return pMem; \
27 } \
28 void* classname::operator new[](size_t count,const std::nothrow_t& tag) \
29 { \
30  void *pMem = NULL; \
31  P6UNUSED(tag); \
32  p6AllocMemory(count,&pMem); \
33  return pMem; \
34 } \
35 void classname::operator delete(void *pMem) \
36 { \
37  p6FreeMemory(pMem); \
38 }
39 
40 #else
41 #define P6_DECL_UEFI_ALLOCATOR
42 #define P6_IMPLEMENT_UEFI_ALLOCATOR(classname)
43 #endif
44 
45 #ifdef __cplusplus
46 #ifdef P6_UEFI
47 
48 void* operator new (size_t count,const std::nothrow_t& tag);
49 void* operator new[](size_t count,const std::nothrow_t& tag);
50 void operator delete(void *p);
51 #endif
52 #endif
53 
54 #endif
Standard error codes.