diff --git a/checkin_notes b/checkin_notes index 71c47bcfc4..4bd8c1c05f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/clientgui/mac/config.h b/clientgui/mac/config.h index a82f3b4724..315c9e40b0 100644 --- a/clientgui/mac/config.h +++ b/clientgui/mac/config.h @@ -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 diff --git a/configure.ac b/configure.ac index 2a3aaa9957..8c4193179d 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/lib/parse.h b/lib/parse.h index ec7304307b..3ab2672274 100644 --- a/lib/parse.h +++ b/lib/parse.h @@ -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 1234 // return true if it's there