Ethereal-dev: Re: [ethereal-dev] Small patches for C++ compatability

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Sat, 27 May 2000 01:13:14 -0700
(This mail may also show up from "guy@xxxxxxxxxx" eventually; NetApp's
mail gateway is currently down as protection for the latest
{Visual,Word} Basic macro pestilence, so my mail on it didn't get out; I
don't know when it'll be turned on again.)

On Fri, May 26, 2000 at 04:26:57PM +0200, andreas.sikkema@xxxxxxxxxxx wrote:
> These patches make sure that a C++ compiler won't complain about:

	...

> - redefining a GLib struct

If that's

	--- ../original/packet.h	Fri May 05 11:32:10 2000
	+++ packet.h	Thu May 11 14:40:15 2000
	@@ -202,11 +202,12 @@
	 extern packet_info pi;
 
	 /* Struct for the match_strval function */
	-
	+#ifndef __cplusplus
	 typedef struct _value_string {
	   guint32  value;
	   gchar   *strptr;
	 } value_string;
	+#endif
 
	 /* Struct for boolean enumerations */
	 typedef struct true_false_string {

which GLib structure is being redefined here? I don't see any "struct
_value_string", or "value_string" typedef, in GLib 1.2.7, GLib 1.2.8, or
the current GLib in CVS.

In addition, defining that structure only in C code means that C++ code
cannot use "value_to_str()" and "match_strval()", and cannot define
fields that have a "value_string" table associated with them, which is
probably not what we want.