25 #ifndef _UCOMMON_CONFIG_H_
29 #ifndef _UCOMMON_CPR_H_
30 #define _UCOMMON_CPR_H_
35 __EXPORT
int cpr_setenv(
const char *s,
const char *v,
int p);
37 inline int setenv(
const char *s,
const char *v,
int overwrite)
38 {
return cpr_setenv(s, v, overwrite);}
52 extern "C" __EXPORT
void *cpr_newp(
void **handle,
size_t size);
54 extern "C" __EXPORT
void cpr_freep(
void **handle);
62 extern "C" __EXPORT
void *
cpr_memalloc(
size_t size) __MALLOC;
73 extern "C" __EXPORT
void *
cpr_memassign(
size_t size, caddr_t address,
size_t known) __MALLOC;
81 extern "C" __EXPORT
void cpr_memswap(
void *mem1,
void *mem2,
size_t size);
83 #ifndef _UCOMMON_EXTENDED_
89 __EXPORT
void *
operator new(
size_t size);
96 __EXPORT
void *
operator new[](
size_t size);
99 #ifndef _UCOMMON_EXTENDED_
108 __EXPORT
void *
operator new[](
size_t size, caddr_t address);
119 __EXPORT
void *
operator new[](
size_t size, caddr_t address,
size_t known);
131 __EXPORT
void *
operator new(
size_t size,
size_t extra);
141 __EXPORT
void *
operator new(
size_t size, caddr_t address);
153 __EXPORT
void *
operator new(
size_t size, caddr_t address,
size_t known);
155 #ifndef _UCOMMON_EXTENDED_
160 #if __cplusplus <= 199711L
161 __EXPORT
void operator delete(
void *object);
163 __EXPORT
void operator delete(
void *object) noexcept (
true);
170 #if __cplusplus <= 199711L
171 __EXPORT
void operator delete[](
void *array);
173 __EXPORT
void operator delete[](
void *array) noexcept(
true);
177 extern "C" __EXPORT
void __cxa_pure_virtual(
void);
182 __EXPORT uint16_t lsb_getshort(uint8_t *b);
183 __EXPORT uint32_t lsb_getlong(uint8_t *b);
184 __EXPORT uint16_t msb_getshort(uint8_t *b);
185 __EXPORT uint32_t msb_getlong(uint8_t *b);
187 __EXPORT
void lsb_setshort(uint8_t *b, uint16_t v);
188 __EXPORT
void lsb_setlong(uint8_t *b, uint32_t v);
189 __EXPORT
void msb_setshort(uint8_t *b, uint16_t v);
190 __EXPORT
void msb_setlong(uint8_t *b, uint32_t v);
193 template <
typename T>
194 T *newp(T **handle) {
195 return (T*)cpr_newp(handle,
sizeof(T));
198 template <
typename T>
199 void freep(T **handle) {
void cpr_runtime_error(const char *text)
Function to handle runtime errors.
Various miscellaneous platform specific headers and defines.
void * cpr_memalloc(size_t size)
Portable memory allocation helper function.
void cpr_memswap(void *mem1, void *mem2, size_t size)
Portable swap code.
void * cpr_memassign(size_t size, caddr_t address, size_t known)
Portable memory placement helper function.