[evolution-mapi] Latest openchange svn has mem_ctx param on cast_SPropValue



commit c7f4dd64a20b4772f1284ebd25ec2114d7902e0d
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jun 24 12:21:52 2010 +0200

    Latest openchange svn has mem_ctx param on cast_SPropValue

 configure.ac                                   |   14 ++++++++++++++
 src/libexchangemapi/exchange-mapi-connection.c |    6 +++++-
 2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 3ccec9d..98c32c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -168,6 +168,20 @@ LIBS=$save_libs
 AC_MSG_RESULT([$ac_cv_have_ggtc])
 
 dnl ****************************
+dnl Check for cast_SPropValue function with three params
+dnl ****************************
+AC_MSG_CHECKING([libmapi cast_SPropValue function with three params])
+save_cflags=$CFLAGS; CFLAGS=$LIBMAPI_CFLAGS
+save_libs=$LIBS; LIBS="$LIBMAPI_LIBS"
+AC_LINK_IFELSE([AC_LANG_PROGRAM(
+	[[#include <libmapi/libmapi.h>]],
+	[[cast_SPropValue (NULL, NULL, NULL)]])],
+	[AC_DEFINE(HAVE_MEMCTX_ON_CAST_SPROPVALUE, 1, [libmapi provides cast_SPropValue with mem context parameter]) ac_cv_have_mocs=yes],[ac_cv_have_mocs=no])
+CFLAGS=$save_cflags
+LIBS=$save_libs
+AC_MSG_RESULT([$ac_cv_have_mocs])
+
+dnl ****************************
 dnl Expose version information
 dnl ****************************
 API_VERSION=$EDS_PACKAGE
diff --git a/src/libexchangemapi/exchange-mapi-connection.c b/src/libexchangemapi/exchange-mapi-connection.c
index 3a9e568..688f65b 100644
--- a/src/libexchangemapi/exchange-mapi-connection.c
+++ b/src/libexchangemapi/exchange-mapi-connection.c
@@ -944,7 +944,11 @@ exchange_mapi_util_get_attachments (ExchangeMapiConnection *conn, mapi_id_t fid,
 		attachment->cValues = properties.cValues;
 		attachment->lpProps = g_new0 (struct SPropValue, attachment->cValues + 1);
 		for (z=0; z < properties.cValues; z++) {
-			cast_SPropValue (&properties.lpProps[z], &(attachment->lpProps[z]));
+			cast_SPropValue (
+				#ifdef HAVE_MEMCTX_ON_CAST_SPROPVALUE
+				mem_ctx,
+				#endif
+				&properties.lpProps[z], &(attachment->lpProps[z]));
 
 			if ((attachment->lpProps[z].ulPropTag & 0xFFFF) == PT_STRING8) {
 				struct SPropValue *lpProps;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]