26 #ifndef _UCOMMON_CONFIG_H_ 30 #ifndef _UCOMMON_CPR_H_ 31 #define _UCOMMON_CPR_H_ 36 __EXPORT
int setenv(
const char *s,
const char *v,
int p);
38 __EXPORT
int gettimeofday(
struct timeval *tv,
void *tz);
54 extern "C" __EXPORT
void *cpr_newp(
void **handle,
size_t size);
56 extern "C" __EXPORT
void cpr_freep(
void **handle);
64 extern "C" __EXPORT
void *
cpr_memalloc(
size_t size) __MALLOC;
75 extern "C" __EXPORT
void *
cpr_memassign(
size_t size, caddr_t address,
size_t known) __MALLOC;
83 extern "C" __EXPORT
void cpr_memswap(
void *mem1,
void *mem2,
size_t size);
85 #ifdef UCOMMON_SYSRUNTIME 91 __EXPORT
void *
operator new(
size_t size);
98 __EXPORT
void *
operator new[](
size_t size);
108 __EXPORT
void *
operator new[](
size_t size,
void *address);
119 __EXPORT
void *
operator new[](
size_t size,
void *address,
size_t known);
125 #if __cplusplus <= 199711L 126 __EXPORT
void operator delete(
void *object);
128 __EXPORT
void operator delete(
void *object) noexcept (
true);
135 #if __cplusplus <= 199711L 136 __EXPORT
void operator delete[](
void *array);
138 __EXPORT
void operator delete[](
void *array) noexcept(
true);
142 extern "C" __EXPORT
void __cxa_pure_virtual(
void);
147 #if !defined(_MSWINDOWS_) && !defined(__QNX__) 148 __EXPORT
int stricmp(
const char *s1,
const char *s2);
149 __EXPORT
int strnicmp(
const char *s1,
const char *s2,
size_t size);
151 #elif defined(_MSWINDOWS_) 152 inline char *strdup(
const char *s)
155 inline int stricmp(
const char *s1,
const char *s2)
156 {
return _stricmp(s1, s2);}
158 inline int strnicmp(
const char *s1,
const char *s2,
size_t size)
159 {
return _strnicmp(s1, s2, size);}
162 __EXPORT uint16_t lsb_getshort(uint8_t *b);
163 __EXPORT uint32_t lsb_getlong(uint8_t *b);
164 __EXPORT uint16_t msb_getshort(uint8_t *b);
165 __EXPORT uint32_t msb_getlong(uint8_t *b);
167 __EXPORT
void lsb_setshort(uint8_t *b, uint16_t v);
168 __EXPORT
void lsb_setlong(uint8_t *b, uint32_t v);
169 __EXPORT
void msb_setshort(uint8_t *b, uint16_t v);
170 __EXPORT
void msb_setlong(uint8_t *b, uint32_t v);
172 __EXPORT
long tzoffset(
struct timezone *tz = NULL);
175 template <
typename T>
176 T *newp(T **handle) {
177 return static_cast<T*>(cpr_newp(handle,
sizeof(T)));
180 template <
typename T>
181 void freep(T **handle) {
void * cpr_memassign(size_t size, caddr_t address, size_t known)
Portable memory placement helper function.
void cpr_runtime_error(const char *text)
Function to handle runtime errors.
void cpr_memswap(void *mem1, void *mem2, size_t size)
Portable swap code.
Various miscellaneous platform specific headers and defines.
void * cpr_memalloc(size_t size)
Portable memory allocation helper function.