cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CMake: fix for Windows x64 build with MSVS Compiler

From: Yang Tse <yangsita_at_gmail.com>
Date: Thu, 29 Mar 2012 16:23:22 +0200

2012/3/28 tetetest tetetest <tetetest_at_rambler.ru> wrote:

> There is a strange bug in MS Visual Studio 2010 for x64 compiler: while it
> readily accepts 'ULL' as a valid suffix for unsigned long long literals,
> it rejects 'LLU'.

When using Visual Studio CMakeLists.txt files should most likely be
following more closely appropiate definitions from
include/curl/curlbuild.h.dist and lib/config-win32.h and try to
generate/match what already exists in those files.

In this case the problem wouldn't exist for cmake buids it it were
using Visual studio definitions from include/curl/curlbuild.h.dist
given that these work for all versions of VS since VS6 up to nowadays.
and not the ones from CMakeLists.txt which are not supported on all VS
versions...

# define CURL_TYPEOF_CURL_OFF_T __int64
# define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_FORMAT_CURL_OFF_TU "I64u"
# define CURL_FORMAT_OFF_T "%I64d"
# define CURL_SIZEOF_CURL_OFF_T 8
# define CURL_SUFFIX_CURL_OFF_T i64
# define CURL_SUFFIX_CURL_OFF_TU ui64

> The bug is strange because both 'ULL' and 'LLU' suffixes are okay for the
> 32-bit compiler that comes along with the x64 one.
>
> Other compilers (GCC, Intel ICC) accept both forms.

Don't expect MS fixing the bug, or at least don't hold your breath, it
has already been reported more than 5 years ago for other VS
versions...

http://connect.microsoft.com/VisualStudio/feedback/details/308123/integral-literal-doesnt-support-llu-suffix

-- 
-=[Yang]=-
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-29