Re: [gtk-list] OT: size_t and 64 bits
- From: Havoc Pennington <hp redhat com>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] OT: size_t and 64 bits
- Date: Thu, 21 Oct 1999 21:55:29 -0400 (EDT)
On Thu, 21 Oct 1999, John C Atkeson wrote:
>
> If I recompile my gtk code to 64-bit, does size_t become a 64-bit
> integer?
> I'm trying to use types that will scale as our systems advance.
>
If you use plain "int" and "unsigned int" (or gint and guint) they will be
64 bits on 64-bit platforms. But you shouldn't have to worry about this;
you shouldn't be using int/uint unless you know your value won't exceed
the range of a 32-bit integer. If you're going to exceed that value then
you probably have to use floating point or some kind of big-int library.
If you need a specific size integer, then use the gint32, gint64, etc.
macros from glib. But notice that gint64 isn't defined on all platforms,
there is a preprocessor symbol defined in glibconfig.h that tells you if
it is.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]