![]() ![]() GLib documents "gsize" and "gssize" data types, and offers G_GSIZE_MODIFIER, G_GSSIZE_FORMAT, and G_GSIZE_FORMAT #defines if they're supported by all the versions of GLib that we support, if we use "gsize" instead of "size_t" and "gssize" instead of "ssize_t", and use G_GSIZE_FORMAT and G_GSSIZE_FORMAT to print them, that should handle that problem. ![]() Using long and size_t interchangeably may work on LP64 platforms, but it doesn't work on LLP64 platforms such as Win64. This also can cause problems on LP64 platforms - most objects won't be of a size > 2^31-1, but printing a size_t can't always be done with %d or %u. Other compilers may not care, but this breaks compilation in Visual C++ (2008, at least). We use int and size_t interchangeably in a lot of places. Sizeof(size_t) != sizeof(int) and sizeof(size_t) != sizeof(long) Linux, Solaris, macOS, *BSD, AIX, HP-UX, other UN*Xes, !Windows Windows, Linux, Solaris, macOS, *BSD, AIX, HP-UX, other UN*Xes If you assume that long ints and pointers have the same number of bits, you're in trouble: Data model 64-bit UN*X platform use the LP64 data model however, 64-bit Windows uses the LLP64 data model. ![]() ILP32, LP64, and LLP64ģ2-bit UN*X platforms, and 32-bit Windows, use the ILP32 data model. This requires extra care when writing code for Wireshark, as described below. Wireshark 1.2.0 introduced official support for 64-bit Windows. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |