News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

simplan.h - anonymous union

Started by Ashley, February 17, 2012, 05:10:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ashley

While working on compiling Simutrans using Xcode I found that it was having trouble coping with using an anonymous union in the planquadrat_t object with the swap template:


void swap(planquadrat_t& a, planquadrat_t& b)
{
sim::swap(a.this_halt, b.this_halt);
sim::swap(a.halt_list, b.halt_list);
sim::swap(a.ground_size, b.ground_size);
sim::swap(a.halt_list_count, b.halt_list_count);
sim::swap(a.data, b.data);
}


Giving the union a name seems to fix this. One-line patch attached.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.