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 <guy@xxxxxxxxxx>
Date: Fri, 26 May 2000 14:37:17 -0700 (PDT)
> These patches make sure that a C++ compiler won't complain about:
> - typedef struct GNode where GNOde is already a struct
> - 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

which GLib structure is being redefined here?


Is there a "value_string" structure in GLib 1.3?  I see none in 1.2.7.

If there's a new "value_string" structure in GLib 1.3, we should
probably just rename our "value_string" structure to something else;
simply not defining it at all in C++ code means that C++ code cannot use
"val_to_str()" and "match_strval()", and cannot define fields that are
"enumerated" types with a "value_string" table associated with them,
which is probably not what we want.