1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

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); void abort(void);
int atoi(const char*); int atoi(const char*);
long atol(const char*);
long long atoll(const char*);
void* calloc(size_t, size_t); void* calloc(size_t, size_t);
void exit(int); void exit(int);
void _Exit(int status); void _Exit(int status);
@ -67,9 +69,6 @@ long a64l(const char* s);
int abs(int value); int abs(int value);
int atexit(void (*function)(void)); int atexit(void (*function)(void));
double atof(const char* value); 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*)); void* bsearch(const void*, const void*, size_t, size_t, int (*)(const void*, const void*));
div_t div(int, int); div_t div(int, int);
double drand48(void); double drand48(void);

View file

@ -106,6 +106,24 @@ namespace Maxsi
{ {
return ParseInteger<unsigned long long int, true>(str, endptr, base); 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);
}
} }
} }