Commit fbaead2a authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

COMP: Remove warning about assigning 0x8000000000000000L to long long

parent e46b0a92
......@@ -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
......@@ -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)
......
......@@ -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}
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment