COMP: Remove warning about assigning 0x8000000000000000L to long long

This commit is contained in:
Andy Cedilnik 2004-10-07 17:48:36 -04:00
parent e46b0a9290
commit fbaead2a09
4 changed files with 23 additions and 0 deletions

View File

@ -521,3 +521,15 @@ main () {
return 0;
}
#endif
#ifdef HAVE_LONG_LONG_CONSTANT
int main()
{
long long c = 0x8000000000000000LL;
long long k = 0x7FFFFFFFFFFFFFFFLL;
if ( c == 0x8000000000000000LL && c != k )
{
return 0;
}
return 1;
}
#endif

View File

@ -446,6 +446,7 @@ ENDIF(HAVE_FILE_OFFSET_BITS)
FOREACH(CURL_TEST
HAVE_GLIBC_STRERROR_R
HAVE_POSIX_STRERROR_R
HAVE_LONG_LONG_CONSTANT
)
CURL_INTERNAL_TEST_RUN(${CURL_TEST})
ENDFOREACH(CURL_TEST)

View File

@ -504,3 +504,6 @@
/* the signed version of size_t */
#cmakedefine ssize_t ${ssize_t}
/* define if the compiler supports number 0x3627676LL */
#cmakedefine HAVE_LONG_LONG_CONSTANT ${HAVE_LONG_LONG_CONSTANT}

View File

@ -111,10 +111,17 @@ curlx_strtoll(const char *nptr, char **endptr, int base)
}
}
else {
#ifdef HAVE_LONG_LONG_CONSTANT
if (is_negative)
value = 0x8000000000000000LL;
else
value = 0x7FFFFFFFFFFFFFFFLL;
#else
if (is_negative)
value = 0x8000000000000000L;
else
value = 0x7FFFFFFFFFFFFFFFL;
#endif
errno = ERANGE;
}