This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

No Subject


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@hotmail.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@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]