From 8638723798727766705 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,1a6b16794da06105 X-Google-Attributes: gidf78e5,public From: llewellyat@dbritschdot.dsldot.xmissiondot.com Subject: Re: integer types Date: 2000/07/02 Message-ID: #1/1 X-Deja-AN: 641241640 Approved: Fergus Henderson , moderator of comp.std.c++ References: <8jb3kt$1kig$1@news.hal-pc.org> <8jd8f2$27pk$1@news.hal-pc.org> <395AAA43.BB638066@wizard.net> X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Trace: mail2news.demon.co.uk 962469821 mail2news:24142 mail2news mail2news.demon.co.uk Organization: XMission http://www.xmission.com/ X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) User-Agent: Gnus/5.0806 (Gnus v5.8.6) Emacs/20.6 Mime-Version: 1.0 NNTP-Posting-Date: 30 Jun 2000 11:24:48 GMT Newsgroups: comp.std.c++ James Kuyper writes: > Greg Brewer wrote: > > > > That was my guess. I was unsure about MS support. It's one of those things > > that I use if I must but avoid if I can. I've been stuck on a problem > > because I lack a 64bit integer; this allows me to proceed until a long long > > becomes available. I wish there was a way to detect its availability; sort > > of a > > #if defined(long long) > > long long f(void); > > #else > > __int64 f(void); > > #endif > > coding. > > In C99, you can write the following: > > #include > #ifdef INT64_MAX > // The optional type with exactly 64 bits exists > int64_t f(void); > #else > // The type with at least 64 bits is mandatory > int_least64_t f(void); > #endif > > I think you can reasonably assume that future versions of the C++ > standard will borrow this feature of C99. C++ compilers that share code > with C99 compilers will probably provide as an extension much > earlier than that. hm... since most (all?) of can be implemented as typedefs, (well, actually that assumes already having a 64 bit integral type; I guess I am too used to the ubiquity of 'long long' on unices) I would suspect it will be a matter of whether comes with the compiler / c library. (As one example, gcc (freestanding C compiler) does not support int64_t and friends. However, if the system C library has , (linux with glibc >= 2.1.2 being one example), int64_t etc work fine with C++, as they are only typedefs. ) --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]