Package: exult Severity: normal Tags: patch When building 'exult' on amd64 with gcc-4.0, I get the following error:
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I./../headers -I./.. -I./../files -I./../imagewin -I/usr/include/SDL -D_REENTRANT -I/usr/include/freetype2 -DXWIN -O2 -Wno-long-long -g -O2 -Wp,-MD,.deps/bodies.pp -c bodies.cc -o bodies.o ../hash_utils.h:32: error: 'std::hash_map' has not been declared ../hash_utils.h:50: error: 'std::hash_set' has not been declared ../game.h:60: error: ISO C++ forbids declaration of 'hash_map' with no type ../game.h:60: error: expected ';' before '<' token ../game.h:61: error: ISO C++ forbids declaration of 'hash_map' with no type ../game.h:61: error: expected ';' before '<' token bodies.cc: In static member function 'static int Body_lookup::find(int, int&, int&)': bodies.cc:424: error: expected initializer before '<' token bodies.cc:429: error: 'htable' was not declared in this scope bodies.cc:432: error: expected type-specifier before 'hash_set' bodies.cc:432: error: expected `;' before 'hash_set' bodies.cc:456: error: 'hash_set' was not declared in this scope bodies.cc:456: error: expected primary-expression before 'short' bodies.cc:456: error: expected `;' before 'short' bodies.cc:461: error: 'it' was not declared in this scope bodies.cc:461: error: 'htable' was not declared in this scope make[3]: *** [bodies.lo] Error 1 make[3]: Leaving directory `/exult-1.2/shapes' With the attached patch 'exult' can be compiled on amd64 using gcc-4.0. Regards Andreas Jochens diff -urN ../tmp-orig/exult-1.2/hash_utils.h ./hash_utils.h --- ../tmp-orig/exult-1.2/hash_utils.h 2003-08-31 19:32:24.000000000 +0200 +++ ./hash_utils.h 2005-02-13 10:41:56.000000000 +0100 @@ -26,7 +26,7 @@ #else #if HAVE_EXT_HASH_MAP # include <ext/hash_map> -# if (defined(__GNUC__) && (__GNUC__ == 3) && ( __GNUC_MINOR__ > 0)) +# if (defined(__GNUC__) && (((__GNUC__ == 3) && ( __GNUC_MINOR__ > 0)) || __GNUC__ >= 4)) using __gnu_cxx::hash_map; # else using std::hash_map; @@ -44,7 +44,7 @@ #else #if HAVE_EXT_HASH_SET # include <ext/hash_set> -# if (defined(__GNUC__) && (__GNUC__ == 3) && ( __GNUC_MINOR__ > 0)) +# if (defined(__GNUC__) && (((__GNUC__ == 3) && ( __GNUC_MINOR__ > 0)) || __GNUC__ >= 4)) using __gnu_cxx::hash_set; # else using std::hash_set; diff -urN ../tmp-orig/exult-1.2/mapedit/npcedit.cc ./mapedit/npcedit.cc --- ../tmp-orig/exult-1.2/mapedit/npcedit.cc 2004-04-26 06:59:14.000000000 +0200 +++ ./mapedit/npcedit.cc 2005-02-13 11:02:25.423507594 +0100 @@ -234,7 +234,7 @@ GtkLabel *label = GTK_LABEL(glade_xml_get_widget(app_xml, lname)); g_free(lname); // User data = schedule #. - sched.type = (int) gtk_object_get_user_data(GTK_OBJECT(label)); + sched.type = (long) gtk_object_get_user_data(GTK_OBJECT(label)); if (sched.type < 0 || sched.type > 31) return false; // Get location. @@ -600,7 +600,7 @@ int shape = get_num_entry("npc_shape"); int frame = get_num_entry("npc_frame"); GtkWidget *fw = glade_xml_get_widget(app_xml, "npc_face_frame"); - int face = (int) gtk_object_get_user_data(GTK_OBJECT(fw)); + long face = (long) gtk_object_get_user_data(GTK_OBJECT(fw)); int usecode = get_num_entry("npc_usecode_entry"); short attack_mode = get_optmenu("npc_attack_mode"); short alignment = get_optmenu("npc_alignment"); @@ -723,7 +723,7 @@ return; npc_face_draw->configure(); GtkWidget *frame = glade_xml_get_widget(app_xml, "npc_face_frame"); - int shnum = (int) gtk_object_get_user_data(GTK_OBJECT(frame)); + long shnum = (long) gtk_object_get_user_data(GTK_OBJECT(frame)); npc_face_draw->draw_shape_centered(shnum, 0); if (w != -1) npc_face_draw->show(x, y, w, h); diff -urN ../tmp-orig/exult-1.2/mapedit/studio.cc ./mapedit/studio.cc --- ../tmp-orig/exult-1.2/mapedit/studio.cc 2004-04-26 06:32:13.000000000 +0200 +++ ./mapedit/studio.cc 2005-02-13 11:03:59.533339828 +0100 @@ -2009,7 +2009,7 @@ gpointer data ) { - guint32 color = (guint32) gtk_object_get_user_data(GTK_OBJECT(widget)); + guint32 color = (long) gtk_object_get_user_data(GTK_OBJECT(widget)); GdkGC *gc = (GdkGC *) gtk_object_get_data(GTK_OBJECT(widget), "color_gc"); if (!gc) @@ -2071,7 +2071,7 @@ config->set("config/estudio/default_game", default_game, true); GtkWidget *backgrnd = glade_xml_get_widget(app_xml, "prefs_background"); - background_color = (guint32) gtk_object_get_user_data( + background_color = (long) gtk_object_get_user_data( GTK_OBJECT(backgrnd)); config->set("config/estudio/background_color", background_color, true); // Set background color. diff -urN ../tmp-orig/exult-1.2/usecode/useval.cc ./usecode/useval.cc --- ../tmp-orig/exult-1.2/usecode/useval.cc 2004-05-23 07:07:11.000000000 +0200 +++ ./usecode/useval.cc 2005-02-13 10:53:32.000000000 +0100 @@ -464,7 +464,7 @@ if (buflen < 5) return -1; *ptr++ = type; - Write4(ptr, (int)value.ptr); + Write4(ptr, (long)value.ptr); break; case string_type: { -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]