Package: widelands
Severity: normal
Tags: patch
When building 'widelands' on amd64 with gcc-4.0,
I get the following error:
src/filesystem.h:124: error: 'Little16' was not declared in this scope
src/filesystem.h: In member function 'int FileRead::Signed32(int)':
src/filesystem.h:125: error: 'Little32' was not declared in this scope
src/filesystem.h: In member function 'uint FileRead::Unsigned32(int)':
src/filesystem.h:126: error: 'Little32' was not declared in this scope
src/filesystem.h: In member function 'float FileRead::Float(int)':
src/filesystem.h:127: error: 'LittleFloat' was not declared in this scope
src/filesystem.h: In member function 'void FileWrite::Signed16(short int, int)':
src/filesystem.h:174: error: 'Little16' was not declared in this scope
src/filesystem.h: In member function 'void FileWrite::Unsigned16(ushort, int)':
src/filesystem.h:175: error: 'Little16' was not declared in this scope
src/filesystem.h: In member function 'void FileWrite::Signed32(int, int)':
src/filesystem.h:176: error: 'Little32' was not declared in this scope
src/filesystem.h: In member function 'void FileWrite::Unsigned32(uint, int)':
src/filesystem.h:177: error: 'Little32' was not declared in this scope
src/filesystem.h: In member function 'void FileWrite::Float(float, int)':
src/filesystem.h:178: error: 'LittleFloat' was not declared in this scope
make[1]: *** [src/native-release/building.o] Error 1
make[1]: Leaving directory `/widelands-build8'
make: *** [debian/stamp-makefile-build] Error 2
With the attached patch 'widelands' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/widelands-build8/src/machdep.h ./src/machdep.h
--- ../tmp-orig/widelands-build8/src/machdep.h 2004-09-23 17:39:40.000000000
+0200
+++ ./src/machdep.h 2005-01-10 14:30:02.717117664 +0100
@@ -24,7 +24,7 @@
// TODO: figure out a way to define these portably
// Currently supported: i386, PowerPC, Sparc
-#if defined (__ppc__)
+#if defined (__ppc__) || defined(__powerpc64__)
#undef P_LITTLE_ENDIAN
#define P_BIG_ENDIAN
#undef P_ALIGNMENT
@@ -32,7 +32,7 @@
#undef P_LITTLE_ENDIAN
#define P_BIG_ENDIAN
#define P_ALIGNMENT
-#elif defined (__i386__)
+#elif defined (__i386__) || defined(__x86_64__)
#undef P_BIG_ENDIAN
#define P_LITTLE_ENDIAN
#undef P_ALIGNMENT
diff -urN
../tmp-orig/widelands-build8/src/editor/ui_menus/editor_player_menu_allowed_buildings_menu.cc
./src/editor/ui_menus/editor_player_menu_allowed_buildings_menu.cc
---
../tmp-orig/widelands-build8/src/editor/ui_menus/editor_player_menu_allowed_buildings_menu.cc
2004-09-23 17:39:39.000000000 +0200
+++ ./src/editor/ui_menus/editor_player_menu_allowed_buildings_menu.cc
2005-01-10 14:52:33.115825856 +0100
@@ -132,7 +132,7 @@
// Remove from one list
- int index=((int)source->get_selection());
+ long index=((long)source->get_selection());
source->remove_entry(source->get_selection_index());
source->sort();
diff -urN ../tmp-orig/widelands-build8/src/fieldaction.cc ./src/fieldaction.cc
--- ../tmp-orig/widelands-build8/src/fieldaction.cc 2004-09-23
17:39:39.000000000 +0200
+++ ./src/fieldaction.cc 2005-01-10 14:39:35.699011176 +0100
@@ -107,7 +107,7 @@
*/
void BuildGrid::clickslot(int idx)
{
- int id = (int)get_data(idx);
+ long id = (long)get_data(idx);
buildclicked.call(id);
}
diff -urN ../tmp-orig/widelands-build8/src/game_debug_ui.cc
./src/game_debug_ui.cc
--- ../tmp-orig/widelands-build8/src/game_debug_ui.cc 2004-09-23
17:39:39.000000000 +0200
+++ ./src/game_debug_ui.cc 2005-01-10 14:40:21.555040000 +0100
@@ -362,7 +362,7 @@
*/
void FieldDebugWindow::open_bob(int idx)
{
- uint serial = (uint)m_ui_bobs->get_selection();
+ unsigned long serial = (unsigned long)m_ui_bobs->get_selection();
if (!serial)
return;
diff -urN ../tmp-orig/widelands-build8/src/interactive_base.cc
./src/interactive_base.cc
--- ../tmp-orig/widelands-build8/src/interactive_base.cc 2004-09-23
17:39:39.000000000 +0200
+++ ./src/interactive_base.cc 2005-01-10 14:40:58.220466008 +0100
@@ -446,7 +446,7 @@
Path *path = new Path(*m_buildroad);
if(m_egbase->is_game()) {
// Build the path as requested
-
static_cast<Game*>(m_egbase)->send_player_command(m_road_build_player,
CMD_BUILD_ROAD, (int)path, 0, 0);
+
static_cast<Game*>(m_egbase)->send_player_command(m_road_build_player,
CMD_BUILD_ROAD, (long)path, 0, 0);
} else {
get_egbase()->get_player(m_road_build_player)->build_road(path);
delete path;
diff -urN ../tmp-orig/widelands-build8/src/transport.cc ./src/transport.cc
--- ../tmp-orig/widelands-build8/src/transport.cc 2004-09-23
17:39:39.000000000 +0200
+++ ./src/transport.cc 2005-01-10 14:43:38.449107552 +0100
@@ -3656,7 +3656,7 @@
m_request_timer = true;
m_request_timer_time = game->get_gametime() + delta;
cq->queue(m_request_timer_time, SENDER_MAPOBJECT, CMD_CALL,
- (int)(&Economy::request_timer_cb),
m_trackserial, 0);
+ (long)(&Economy::request_timer_cb),
m_trackserial, 0);
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]