31 #ifndef HAVE_WINDOWS_H
42 ::clock_gettime(CLOCK_MONOTONIC, &ts);
43 return (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
49 return 0 == ::mkdir( name,
50 S_IRUSR | S_IWUSR | S_IXUSR
52 | S_IROTH | S_IXOTH );
57 int asprintf(
char** strp,
const char* fmt, ... )
69 #ifndef HAVE_VASPRINTF
70 int vasprintf(
char** strp,
const char* fmt, va_list ap )
83 *strp = (
char*)::realloc( *strp, size );
97 *strp = (
char*)::realloc( *strp, code + 1 );
122 std::string
vsprintf(
const char* fmt, va_list ap )
133 int sprintf( std::string& str,
const char* fmt, ... )
144 int vsprintf( std::string& str,
const char* fmt, va_list ap )
149 size_t offset = str.length();
156 str.resize( offset + size );
170 str.resize( offset + code );
176 float strtof(
const char* nptr,
char** endptr )
179 return (
float)::strtod( nptr, endptr );
183 #ifndef HAVE_LOCALTIME_R
186 # ifdef HAVE_LOCALTIME_S
187 const errno_t err = ::localtime_s( result, timep );
198 ::memcpy( result, ::localtime( timep ),
sizeof( tm ) );
tm * localtime_r(const time_t *timep, tm *result)
std::string sprintf(const char *fmt,...)
sprintf for std::string.
int vasprintf(char **strp, const char *fmt, va_list ap)
int CreateDirectory(const char *name, void *)
int asprintf(char **strp, const char *fmt,...)
float strtof(const char *nptr, char **endptr)
std::string vsprintf(const char *fmt, va_list ap)
vsprintf for std::string.