From: VMware, Inc <> Date: Tue, 17 Nov 2009 21:41:37 +0000 (-0800) Subject: Remove vmware internal headers from rpcChannel.h. X-Git-Tag: 2009.11.16-210370~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc8f0295423c175eefcb87be96deff6781444331;p=thirdparty%2Fopen-vm-tools.git Remove vmware internal headers from rpcChannel.h. This header will be part of the Tools Core public headers and we don't want to expose our internal headers through it. Replace the ASSERTS() we have in the code with glib checks (that can be switched to asserts at runtime). Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/include/rpcChannel.h b/open-vm-tools/lib/include/rpcChannel.h index 4fdfe3a78..65939fd59 100644 --- a/open-vm-tools/lib/include/rpcChannel.h +++ b/open-vm-tools/lib/include/rpcChannel.h @@ -41,7 +41,7 @@ #endif #include -#include "vmware.h" +#include "vmtools.h" /** Alias for RpcChannel_SetRetVals. */ #define RPCIN_SETRETVALS RpcChannel_SetRetVals @@ -161,11 +161,11 @@ typedef struct RpcChannel { * @return TRUE on success. */ -static INLINE gboolean +G_INLINE_FUNC gboolean RpcChannel_Start(RpcChannel *chan) { - ASSERT(chan != NULL); - ASSERT(chan->start != NULL); + g_return_val_if_fail(chan != NULL, FALSE); + g_return_val_if_fail(chan->start != NULL, FALSE); return chan->start(chan); } @@ -177,11 +177,11 @@ RpcChannel_Start(RpcChannel *chan) * @param[in] chan The RPC channel instance. */ -static INLINE void +G_INLINE_FUNC void RpcChannel_Stop(RpcChannel *chan) { - ASSERT(chan != NULL); - ASSERT(chan->stop != NULL); + g_return_if_fail(chan != NULL); + g_return_if_fail(chan->stop != NULL); chan->stop(chan); } @@ -199,15 +199,15 @@ RpcChannel_Stop(RpcChannel *chan) * @return The status from the remote end (TRUE if call was successful). */ -static INLINE gboolean +G_INLINE_FUNC gboolean RpcChannel_Send(RpcChannel *chan, char *data, size_t dataLen, char **result, size_t *resultLen) { - ASSERT(chan != NULL); - ASSERT(chan->send != NULL); + g_return_val_if_fail(chan != NULL, FALSE); + g_return_val_if_fail(chan->send != NULL, FALSE); return chan->send(chan, data, dataLen, result, resultLen); } diff --git a/open-vm-tools/lib/include/vmtools.h b/open-vm-tools/lib/include/vmtools.h index 694405993..37bcd053e 100644 --- a/open-vm-tools/lib/include/vmtools.h +++ b/open-vm-tools/lib/include/vmtools.h @@ -47,6 +47,16 @@ VMTools_GetDefaultLogDomain(void); # include #endif + +/* Work around a glib limitation: it doesn't set G_INLINE_FUNC on Win32. */ +#if defined(G_PLATFORM_WIN32) +# if defined(G_INLINE_FUNC) +# undef G_INLINE_FUNC +# endif +# define G_INLINE_FUNC static __inline +#endif + + /** * Converts an UTF-8 path to the local (i.e., glib) file name encoding. * This is a no-op on Windows, since the local encoding is always UTF-8 diff --git a/open-vm-tools/services/vmtoolsd/cmdLine.c b/open-vm-tools/services/vmtoolsd/cmdLine.c index 2c0fa59aa..7f487cf16 100644 --- a/open-vm-tools/services/vmtoolsd/cmdLine.c +++ b/open-vm-tools/services/vmtoolsd/cmdLine.c @@ -33,6 +33,7 @@ #endif #include +#include "vm_assert.h" #include "conf.h" #include "rpcout.h" #include "str.h"