lib: use standard implementation of strtoull when available

svn path=/trunk/boinc/; revision=24049
This commit is contained in:
Charlie Fenton 2011-08-26 09:44:50 +00:00
parent 4d45dda3d9
commit 2246e81d0c
4 changed files with 17 additions and 3 deletions

View File

@ -5092,3 +5092,13 @@ David 25 Aug 2011
validator.cpp
html/user/
various
Charlie 26 Aug 2011
- lib: use standard implementation of strtoull when available.
configure.ac
clientgui/
mac/
config.h
lib/
parse.h

View File

@ -211,6 +211,9 @@
/* Define to 1 if you have the `strcasestr' function. */
#define HAVE_STRCASESTR 1
/* Define to 1 if you have the `strtoull' function. */
#define HAVE_STRTOULL 1
/* Define to 1 if `tm_zone' is member of `struct tm'. */
#define HAVE_STRUCT_TM_TM_ZONE 1

View File

@ -655,7 +655,7 @@ AC_FUNC_ALLOCA
if test "${ac_cv_func_alloca_works}" = "yes" ; then
ac_cv_func_alloca="yes"
fi
AC_CHECK_FUNCS(alloca _alloca __builtin_alloca ether_ntoa setpriority sched_setscheduler strlcpy strlcat strcasestr strcasecmp sigaction getutent setutent getisax strdup strdupa daemon stat64 putenv setenv unsetenv res_init)
AC_CHECK_FUNCS(alloca _alloca __builtin_alloca ether_ntoa setpriority sched_setscheduler strlcpy strlcat strcasestr strcasecmp sigaction getutent setutent getisax strdup strdupa daemon stat64 putenv setenv unsetenv res_init strtoull)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

View File

@ -78,10 +78,10 @@ inline bool match_tag(const std::string &s, const char* tag) {
return match_tag(s.c_str(), tag);
}
//TODO: use strtoull() when available
#ifdef _WIN32
#define boinc_strtoull _strtoui64
#elif defined(__APPLE__)
#else
#ifdef HAVE_STRTOULL
#define boinc_strtoull strtoull
#else
inline unsigned long long boinc_strtoull(const char *s, char **, int) {
@ -100,6 +100,7 @@ inline unsigned long long boinc_strtoull(const char *s, char **, int) {
return y;
}
#endif
#endif
// parse an integer of the form <tag>1234</tag>
// return true if it's there