[SDL] [DEMO] Minimal world engine, updated

Daniel Phillips phillips at arcor.de
Fri Jan 24 08:42:01 PST 2003

On Friday 24 January 2003 14:39, you wrote:
> From: "Daniel Phillips"
> > I'd appreciate some more feedback/complaints about build
> > problems at this point, and could somebody please try compiling
> > this on Windows, and tell me how badly my C code breaks VCC.
> *badly*
> [...]
> However, in about 50 places in the code you do this: return
> (vec3){x[0], x[1], x[2]}; In other words, you initialize a vec3
> object on-the-fly. In VisualC++ this is only allowed when declaring
> the variable, like this: vec3 v = { ... }; Everywhere else you
> should set the struct fields separately, i.e. v.x = ...; v.y = ...;
> etc. I did not feel like fixing all of this, so I gave up. If you
> don't mind changing these on-the-fly initializations to "proper"
> declarations, I can give it another shot.
> Hope it helps,

Thanks, it helps a lot.  Compound literals are blessed by C99, as you can see 

  (section, "Compound Literals", starting on page 65)

All the rest of the points are minor as you mentioned, and I already fixed 
most of them in order to compile the code as c++.  However, I rather like my 
compound literals, and they are standard, so perhaps the thing to do is to 
compile with gcc instead of vcc.  Do you have gcc running there?



More information about the SDL mailing list