This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gcc vs. VC++ and UNIONS
- To: help-gcc at gnu dot org
- Subject: gcc vs. VC++ and UNIONS
- From: "Alt.net" <tom at alteredworlds dot com>
- Date: Thu, 21 Oct 1999 12:00:21 -0700
- Newsgroups: gnu.gcc.help
- Organization: Altopia Corp. - Usenet Access - http://www.altopia.com
- Xref: wodc7nx0 gnu.gcc.help:1523
Hi there,
I'm trying to port some Windows C++ code to Linux, and have run into a
non-standard feature of VC++, it seems. Could anyone confirm this - perhaps
I'm missing something here?
MS defines the following:
typedef union _LARGE_INTEGER {
struct {
DWORD LowPart;
LONG HighPart;
};
LONGLONG QuadPart;
} LARGE_INTEGER;
Now quite apart from the issues of what I should typedef DWORD, LONG and
LONGLONG to [for x86 Linux], this doesn't seem to be valid C/C++ according
to g++.
G++ seems to want me to supply a name for the struct inside the union, and
so will NOT allow me to access as follows:
LARGE_INTEGER a;
a.LowPart = whatever;
a.HighPart = whatever2;
and then look at a.QuadPart
Any comments? If anyone has the time to spare, do you agree with the
following type mappings?
VC++ g++ [i86 machines only, for now]/Linux VC++ Help
Description
DWORD unsigned int
32-bit unsigned integer
LONG int
32-bit signed integer
LONGLONG long int
64-bit signed integer
thanks very much,
Tom Gilbert
http://www.AlteredWorlds.com