On Thu, 04 Mar 2010 17:20:07 Jim Michaels wrote:
> in MSVC,
> __int64 x=12345678901234567i64;
> 
> point 1: this type __int64 doesn't require me to #include <windows> to
> define it.  in mingw and mingw-w64, one must #include <basetsd.h>. why?
> 
> point 2: there are also __int32 __int16 and __int8 types.

If I remember correctly, anything that starts with two underscores is 
implementation defined, which means that __int64 is MS compiler specific, so 
including a separate header would make sense to pick it up in mingw 

Since this is a compiler specific (not really mingw but gcc), it makes sense to 
me, in fact IIRC, MSDN specifically states "Microsoft Visual C Specific" for 
those types.  If you need to be able to compile under multiple compilers, I 
would say grab a MS version of stdint.h (since MSVC doesn't have that) and 
#include that, and use the types from there (such as int64_t, int32_t, etc).  
If you just need a type that is at least 64 bits I believe MSVC from 6.0 on 
supports "long long" and "unsigned long long" (at least 64 but could be 
longer)

> 
> point 3: mingw does not utilize the i64 constant thingy (whatever it's
> called) that tells the compiler that this number is of __int64 type.  I do
> not know if there is an i32 or i16 or i8 definition.

That's another GCC, not mingw thing.  GCC supports the suffix of LL and ULL for 
64 bit wide numbers.  MSVC from at least visual studio 2003 (maybe, but don't 
quote me, VC6) also supports these...

> 
> 
> BTW, 128-bit number type is in the C9X standard.  the new integral data
> types in C++ will be something like int64, int32, int128, int16, int8.
> 
> http://www.open-std.org/JTC1/sc22/wg14/www/docs/n615.htm
> 

C9X support in MSVC is flaky at best and nonexistent in several spots (see: 
stdint.h).  I mean the standard has been ratified since what, 2004?  even VS 
2008 doesn't have it!)

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to