File vegastrike-src-0.5.1.r1-gcc6_compat.patch of Package vegastrike
Index: src/cmd/unit_generic.cpp
===================================================================
--- src/cmd/unit_generic.cpp (revision 13699)
+++ src/cmd/unit_generic.cpp (working copy)
@@ -38,6 +38,7 @@
#include "universe_generic.h"
#include "csv.h"
#include "vs_random.h"
+#include "vs_math.h"
#include "galaxy_xml.h"
#include "gfx/camera.h"
@@ -655,6 +656,7 @@
jump.drive = -1;
}
+#if !defined(HAVE_MATH_H)
float copysign( float x, float y )
{
if (y > 0)
@@ -662,6 +664,7 @@
else
return -x;
}
+#endif //!defined(HAVE_MATH_H)
float rand01()
{
Index: src/physics.h
===================================================================
--- src/physics.h (revision 13699)
+++ src/physics.h (working copy)
@@ -22,12 +22,13 @@
#ifndef PHYSICS_H
#define PHYSICS_H
+#include "vs_math.h"
+
#include "gfx/vec.h"
static const float oocc = (float) 0.0000000000000000111265005605; //1/c^2
static const float c = (float) 299792458.0;
static const float co10 = (float) 29979245.8;
-float copysign( float x, float y );
struct Force
{
Index: src/vs_math.h
===================================================================
--- src/vs_math.h (revision 13699)
+++ src/vs_math.h (working copy)
@@ -43,6 +43,8 @@
#if defined (HAVE_MATH_H)
#include <math.h>
+#else
+ float copysign( float x, float y );
#endif
#if defined (HAVE_FINITE) || defined (BSD)
#define FINITE( x ) ( finite( x ) )
Index: src/pk3.cpp
===================================================================
--- src/pk3.cpp 2016-06-17 19:11:35.291170055 -0300
+++ src/pk3.cpp 2016-06-17 19:11:43.374169816 -0300
@@ -356,7 +356,7 @@
}
//if the file isn't in the archive
if (index == -1)
- return false;
+ return NULL;
int flength = GetFileLen( index );
buffer = new char[flength];
Index: src/ship_commands.cpp
===================================================================
--- src/ship_commands.cpp (revision 13699)
+++ src/ship_commands.cpp (working copy)
@@ -5,11 +5,11 @@
#include "universe_util.h"
#include "gldrv/winsys.h"
-static inline float fmin( float a, float b )
+static inline float vs_fmin( float a, float b )
{
return (a < b) ? a : b;
}
-static inline float fmax( float a, float b )
+static inline float vs_fmax( float a, float b )
{
return (a > b) ? a : b;
}
@@ -132,7 +132,7 @@
else
kps /= display_in_meters ? 1.0f : 3.6f;
- player->GetComputerData().set_speed = fmin( player->GetComputerData().max_speed(), kps );
+ player->GetComputerData().set_speed = vs_fmin( player->GetComputerData().max_speed(), kps );
}
}
Index: src/gfx/cockpit_xml.cpp
===================================================================
--- src/gfx/cockpit_xml.cpp 2010-12-15 05:53:40.000000000 -0300
+++ src/gfx/cockpit_xml.cpp 2016-06-17 20:26:22.744037465 -0300
@@ -315,7 +315,7 @@
for (counter = 0; counter < 4; ++counter)
if (!replaced[counter]) {
delete Pit[counter];
- Pit[counter] = false;
+ Pit[counter] = NULL;
}
break;
case UnitImages< void >::SHIELD4:
Index: src/cmd/unit_physics.h
===================================================================
--- src/cmd/unit_physics.h 2012-03-19 05:20:14.000000000 -0300
+++ src/cmd/unit_physics.h 2016-06-17 20:47:41.934999670 -0300
@@ -30,6 +30,7 @@
#include "audiolib.h"
#include "configxml.h"
#include "vs_globals.h"
+#include "vs_math.h"
#ifdef FIX_TERRAIN
#include "gfx/planetary_transform.h"
@@ -41,8 +42,6 @@
#include "networking/lowlevel/vsnet_clientstate.h"
#include "networking/netclient.h"
-extern float copysign( float x, float y );
-
extern unsigned int apply_float_to_unsigned_int( float tmp ); //short fix
template < class UnitType >
Index: objconv/basemaker/base_maker.cpp
===================================================================
--- objconv/basemaker/base_maker.cpp 2010-12-23 17:16:48.000000000 -0300
+++ objconv/basemaker/base_maker.cpp 2016-06-17 21:21:23.802939930 -0300
@@ -2060,7 +2060,7 @@
int main( int argc, char **argv )
{
printf( "Loading...\n" );
- Base::CurrentBase = false;
+ Base::CurrentBase = NULL;
glutInit( &argc, argv );
glutInitWindowSize( 800, 600 );
g_game.x_resolution = 800;