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);
54extern "C" __EXPORT
void *cpr_newp(
void **handle,
size_t size);
56extern "C" __EXPORT
void cpr_freep(
void **handle);
75extern "C" __EXPORT
void *
cpr_memassign(
size_t size, caddr_t address,
size_t known) __MALLOC;
83extern "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);
142extern "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);
177 return static_cast<T*
>(cpr_newp(handle,
sizeof(T)));
181void freep(T **handle) {
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.
void * cpr_memalloc(size_t size)
Portable memory allocation helper function.
void cpr_runtime_error(const char *text)
Function to handle runtime errors.
Various miscellaneous platform specific headers and defines.