Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11282) [C++] typedef / struct member conflict in clien
Home

[Freeciv-Dev] (PR#11282) [C++] typedef / struct member conflict in clien

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11282) [C++] typedef / struct member conflict in client/climisc.h
From: "Frédéric Brière" <fbriere@xxxxxxxxxxx>
Date: Wed, 1 Dec 2004 02:22:33 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11282 >

client/climisc.h has the following definition:

  typedef int cid;
  ...
  struct item {
    cid cid;
    ...


I don't know if this is allowed or not in C++, but g++ chokes on this,
as it confuses both uses of cid.  This patch disambiguates this.


-- 
             Frédéric Brière    <*>    fbriere@xxxxxxxxxxx

 =>  <fbriere@xxxxxxxxxx> IS NO MORE:  <http://www.abacomsucks.com>  <=

Index: client/climisc.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climisc.h,v
retrieving revision 1.51
diff -u -r1.51 climisc.h
--- client/climisc.h    29 Sep 2004 02:24:19 -0000      1.51
+++ client/climisc.h    1 Dec 2004 10:14:45 -0000
@@ -78,7 +78,11 @@
 bool city_building_present(struct city *pcity, cid cid);
 
 struct item {
+#ifdef __cplusplus
+  ::cid cid;
+#else
   cid cid;
+#endif
   char descr[MAX_LEN_NAME + 40];
 
   /* Privately used for sorting */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11282) [C++] typedef / struct member conflict in client/climisc.h, Frédéric Brière <=