]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Remove vmware internal headers from rpcChannel.h.
authorVMware, Inc <>
Tue, 17 Nov 2009 21:41:37 +0000 (13:41 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 17 Nov 2009 21:41:37 +0000 (13:41 -0800)
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 <mvanzin@vmware.com>
open-vm-tools/lib/include/rpcChannel.h
open-vm-tools/lib/include/vmtools.h
open-vm-tools/services/vmtoolsd/cmdLine.c

index 4fdfe3a789b6152acabb36e23ecb30441981cade..65939fd591ea764a40d08bcf9f65b3d627448794 100644 (file)
@@ -41,7 +41,7 @@
 #endif
 
 #include <glib.h>
-#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);
 }
index 6944059934f0b79f1490e11bde9b95eaf84eda2d..37bcd053ee86dc1987005eaec071ed3a116bd9e6 100644 (file)
@@ -47,6 +47,16 @@ VMTools_GetDefaultLogDomain(void);
 #  include <sys/time.h>
 #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
index 2c0fa59aaec58fb7a3755365a7a9ce55c68b2730..7f487cf165edd3f0258251012ce4cf27e62fb65d 100644 (file)
@@ -33,6 +33,7 @@
 #endif
 #include <glib/gi18n.h>
 
+#include "vm_assert.h"
 #include "conf.h"
 #include "rpcout.h"
 #include "str.h"