Uwe Bonnes <bon(a)elektron.ikp.physik.tu-darmstadt.de> writes:
+ todo_wine ok(strstr(buffer,"e+008") != 0,"Sprintf different \"%s\"\n",buffer); + sprintf(buffer,I64x,(ULONGLONG)0xffffffffffffffff);
Long long constants are not portable, you need to compute them from long constants. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard wrote:
Uwe Bonnes <bon(a)elektron.ikp.physik.tu-darmstadt.de> writes:
+ todo_wine ok(strstr(buffer,"e+008") != 0,"Sprintf different \"%s\"\n",buffer); + sprintf(buffer,I64x,(ULONGLONG)0xffffffffffffffff);
Long long constants are not portable, you need to compute them from long constants.
The official way to do it in GCC (any gcc) is 0x1234567812345678LL Just like we used to do 0x12345678L in 16 bit In VC++ it is 0x1234567812345678i64. Intel can do LL as well. Not sure about borland or watcom. What do OS X use? I guess you can do: #ifdef _GCC_ #define i64 LL #endif or the opposite way (#define LL i64 )
"Boaz Harrosh" <boaz(a)hishome.net> wrote:
Long long constants are not portable, you need to compute them from long constants.
The official way to do it in GCC (any gcc) is 0x1234567812345678LL Just like we used to do 0x12345678L in 16 bit In VC++ it is 0x1234567812345678i64. Intel can do LL as well. Not sure about borland or watcom. What do OS X use?
I guess you can do: #ifdef _GCC_ #define i64 LL #endif
or the opposite way (#define LL i64 )
We have to use an approach implemented in include/wine/debug.h, wine_dbgstr_longlong(). Any modifier for LL in the printf format string is not portable. -- Dmitry.
"Dmitry" == Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
Dmitry> "Boaz Harrosh" <boaz(a)hishome.net> wrote: >> >Long long constants are not portable, you need to compute them from >> >long constants. >> > >> > >> > >> >> The official way to do it in GCC (any gcc) is 0x1234567812345678LL >> Just like we used to do 0x12345678L in 16 bit In VC++ it is >> 0x1234567812345678i64. Intel can do LL as well. Not sure about >> borland or watcom. What do OS X use? >> >> I guess you can do: #ifdef _GCC_ #define i64 LL #endif >> >> or the opposite way (#define LL i64 ) Dmitry> We have to use an approach implemented in include/wine/debug.h, Dmitry> wine_dbgstr_longlong(). Any modifier for LL in the printf format Dmitry> string is not portable. But wine_dbgstr_longlong doesn't take a field length, doesn't know how to print decimal or octal and so on... -- Uwe Bonnes bon(a)elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
"Alexandre" == Alexandre Julliard <julliard(a)winehq.org> writes:
Alexandre> Uwe Bonnes <bon(a)elektron.ikp.physik.tu-darmstadt.de> writes: >> + todo_wine ok(strstr(buffer,"e+008") != 0,"Sprintf different >> \"%s\"\n",buffer); + >> sprintf(buffer,I64x,(ULONGLONG)0xffffffffffffffff); Alexandre> Long long constants are not portable, you need to compute Alexandre> them from long constants. The wine code is sprankled with LONGLONG constants, e.g.: dlls/oleaut32/variant.c: LONGLONG lVal = -1; Where is the code in this test suite supposed to differ from the code in the rest of wine? It's supposed to be compiled against the wine windows headers. #include "wine/test.h" -> #include <windef.h> -> #include <winnt.h> and there #ifndef _ULONGLONG_ #define _ULONGLONG_ typedef signed __int64 LONGLONG, *PLONGLONG; typedef unsigned __int64 ULONGLONG, *PULONGLONG; #endif Bye -- Uwe Bonnes bon(a)elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Uwe Bonnes wrote:
Alexandre> Long long constants are not portable, you need to compute Alexandre> them from long constants.
The wine code is sprankled with LONGLONG constants, e.g.:
dlls/oleaut32/variant.c: LONGLONG lVal = -1;
He means constants like 0x12345689LL. You have to do this instead: (LONGLONG)0x1 << 32 | (LONGLONG)0x23456789. Rob
"Robert" == Robert Shearman <R.J.Shearman(a)warwick.ac.uk> writes:
Robert> Uwe Bonnes wrote: >> Alexandre> Long long constants are not portable, you need to compute Alexandre> them from long constants. >> The wine code is sprankled with LONGLONG constants, e.g.: >> >> dlls/oleaut32/variant.c: LONGLONG lVal = -1; >> Robert> He means constants like 0x12345689LL. You have to do this Robert> instead: (LONGLONG)0x1 << 32 | (LONGLONG)0x23456789. Okay!. Any hint how to do for this for decimal numbers? -- Uwe Bonnes bon(a)elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Kills me why we have to work extra time in the position of a compiler. GCC does that fine a macro can fix the msvc way. What are those supported compilers that choke? Uwe Bonnes wrote:
"Robert" == Robert Shearman <R.J.Shearman(a)warwick.ac.uk> writes:
Robert> He means constants like 0x12345689LL. You have to do this Robert> instead: (LONGLONG)0x1 << 32 | (LONGLONG)0x23456789.
Okay!.
Any hint how to do for this for decimal numbers?
Boaz Harrosh wrote:
Kills me why we have to work extra time in the position of a compiler. GCC does that fine a macro can fix the msvc way. What are those supported compilers that choke?
I don't know, but any C99-compatible compiler should support the LL suffix and the ll width format specifier (in the C library). MSVC doesn't support these and AFAIK never will. Rob
Robert Shearman wrote:
I don't know, but any C99-compatible compiler should support the LL suffix and the ll width format specifier (in the C library). MSVC doesn't support these and AFAIK never will.
Rob
Never say never. It does if you: #define LL i64 #define ll i64 So what is exactly the problem ?
participants (5)
-
Alexandre Julliard -
Boaz Harrosh -
Dmitry Timoshkov -
Robert Shearman -
Uwe Bonnes