Mail Archives: cygwin/1997/07/30/01:34:21
I've been doing the job of porting the examples of Petzold's book
"Programing
Windows 95" (now I'm busy with other work, soon I'll post the results)
and I'd
found the same problem with unamed unions under gcc. As I see in your
diff
file you just make this change to the headers:
from MS:
typedef struct tagFoo {
int x;
union {
int a;
char b;
};
double x;
} Foo;
from you:
typedef struct tagFoo {
int x;
union {
int a;
char b;
} u1; <----- you give a name
double x;
} Foo;
and then use that name to acces the members in the program code:
from MS:
... //other code
Foo foo;
foo.a=25;
... //more code
from you:
... //other code
Foo foo;
foo.u1.a=25;
^^ dummy union name
... //more code
But once you give a name to the nested union in the .h file, you can
acces any data menber as the original MS code, you don't have to include
the
"u1"!, at least in beta 17.1. I hope this will make a smaller diff file.
Ismael Jurado
ismaelj AT hotmail DOT com
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -