Added atol(3) and atoll(3).

This commit is contained in:
Jonas 'Sortie' Termansen 2012-03-05 12:53:58 +01:00
parent 422d2fd579
commit 5449ae78f4
2 changed files with 20 additions and 3 deletions

View File

@ -47,6 +47,8 @@ typedef int div_t, ldiv_t, lldiv_t;
void abort(void);
int atoi(const char*);
long atol(const char*);
long long atoll(const char*);
void* calloc(size_t, size_t);
void exit(int);
void _Exit(int status);
@ -67,9 +69,6 @@ long a64l(const char* s);
int abs(int value);
int atexit(void (*function)(void));
double atof(const char* value);
int atoi(const char*);
long atol(const char*);
long long atoll(const char*);
void* bsearch(const void*, const void*, size_t, size_t, int (*)(const void*, const void*));
div_t div(int, int);
double drand48(void);

View File

@ -106,6 +106,24 @@ namespace Maxsi
{
return ParseInteger<unsigned long long int, true>(str, endptr, base);
}
// TODO: This conflicts with libmaxsi/string.cpp:Maxsi::ToInt().
#if 0
extern "C" int atoi(const char* str)
{
return strtol(str, (char **) NULL, 10);
}
#endif
extern "C" long atol(const char* str)
{
return strtol(str, (char **) NULL, 10);
}
extern "C" long long atoll(const char* str)
{
return strtoll(str, (char **) NULL, 10);
}
}
}