xref: /aosp_15_r20/external/federated-compute/fcp/base/new.h (revision 14675a029014e728ec732f129a32e299b2da0601)
1*14675a02SAndroid Build Coastguard Worker #ifndef FCP_BASE_NEW_H_
2*14675a02SAndroid Build Coastguard Worker #define FCP_BASE_NEW_H_
3*14675a02SAndroid Build Coastguard Worker 
4*14675a02SAndroid Build Coastguard Worker #ifdef FCP_NANOLIBC
5*14675a02SAndroid Build Coastguard Worker // Definitions of placement operator new are needed because nanolibc doesn't
6*14675a02SAndroid Build Coastguard Worker // currently have the <new> header.
new(size_t,void * p)7*14675a02SAndroid Build Coastguard Worker inline void* operator new(size_t, void* p) noexcept { return p; }
8*14675a02SAndroid Build Coastguard Worker inline void* operator new[](size_t, void* p) noexcept { return p; }
9*14675a02SAndroid Build Coastguard Worker #else
10*14675a02SAndroid Build Coastguard Worker #include <new>
11*14675a02SAndroid Build Coastguard Worker #endif  // FCP_NANOLIBC
12*14675a02SAndroid Build Coastguard Worker 
13*14675a02SAndroid Build Coastguard Worker #endif  // FCP_BASE_NEW_H_
14