The dissector packet-dcp.c now fails to compile on MacOS X (gcc 4.0.1/Apple). Change G_INLINE_FUNC back to inline per GLib documentation (also remove recommendation in developer's guide to not use inline):

http://library.gnome.org/devel/glib/unstable/glib-Miscellaneous-Macros.html#id2571572

G_INLINE_FUNC

#define             G_INLINE_FUNC
This macro is used to export function prototypes so they can be linked with an external version when no inlining is performed. The file which implements the functions should define G_IMPLEMENTS_INLINES before including the headers which contain G_INLINE_FUNC declarations. Since inlining is very compiler-dependent using these macros correctly is very difficult. Their use is strongly discouraged.

This macro is often mistaken for a replacement for the inline keyword; inline is already declared in a portable manner in the glib headers and can be used normally.


svn path=/trunk/; revision=22980
This commit is contained in:
Stephen Fisher 2007-09-26 03:05:42 +00:00
parent 8a0da81237
commit 5775a1dca8
2 changed files with 1 additions and 8 deletions

View File

@ -94,13 +94,6 @@ Don't declare variables in the middle of executable code; not all C
compilers support that. Variables should be declared outside a
function, or at the beginning of a function or compound statement.
Don't use "inline"; not all compilers support it. If you want to have a
function be an inline function if the compiler supports it, use
G_INLINE_FUNC, which is declared by <glib.h>. This may not work with
functions declared in header files; if it doesn't work, don't declare
the function in a header file, even if this requires that you not make
it inline on any platform.
Don't use anonymous unions; not all compilers support it. Example:
typedef struct foo {
guint32 foo;

View File

@ -549,7 +549,7 @@ static void dissect_options(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *d
} /* end while() */
}
/* compute DCCP checksum coverage according to RFC 4340, section 9 */
static G_INLINE_FUNC guint dccp_csum_coverage(const e_dcphdr *dcph, guint len)
static inline guint dccp_csum_coverage(const e_dcphdr *dcph, guint len)
{
guint cov;