Fixed an alignement issue...

...which caused a SIGBUS on a Sparc (debian bug #426318).

The patch has been tested by Rhonda.
This commit is contained in:
Mark de Wever 2008-03-18 18:05:09 +00:00
parent 7e83dceaaf
commit f514577f6a
2 changed files with 10 additions and 0 deletions

View file

@ -88,6 +88,8 @@ Version 1.5.0-svn:
have multiple layers and the calculation and rendering are separated
which means things can be drawn in front of units.
* removed the now unused tilestack based drawing.
* fixed an alignement issue which caused a SIGBUS on a Sparc (debian bug
#426318)
Version 1.4:
* language and i18n:

View file

@ -367,7 +367,15 @@ static SOCKET_STATE send_buffer(TCPsocket sock, std::vector<char>& buf)
static SOCKET_STATE receive_buf(TCPsocket sock, std::vector<char>& buf)
{
#ifdef __GNUC__
// The address needs to be aligned on a Sparc system, if it's not aligned
// the SDLNet_Read32 call will cause a SIGBUS and the server will be
// terminated.
// http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426318
char num_buf[4] __attribute__ ((aligned (4)));
#else
char num_buf[4];
#endif
bool res = receive_with_timeout(sock,num_buf,4,false);
if(!res) {