libexchange2ical: handle change in function signature introduced in libical 0.46
authorbradh <bradh@71d39326-ef09-db11-b2a4-00e04c779ad1>
Sun, 13 Feb 2011 08:50:04 +0000 (08:50 +0000)
committerbradh <bradh@71d39326-ef09-db11-b2a4-00e04c779ad1>
Sun, 13 Feb 2011 08:50:04 +0000 (08:50 +0000)
git-svn-id: https://svn.openchange.org/openchange@2643 71d39326-ef09-db11-b2a4-00e04c779ad1

trunk/config.mk.in
trunk/configure.ac
trunk/libexchange2ical/exchange2ical_property.c

index 863378db320fcac7301fcd56dc625050759807ee..ff9a7f88504384ad5c706dd2d1d06016881de9f6 100644 (file)
@@ -37,7 +37,8 @@ CFLAGS=@CFLAGS@ @COMPILER_OPTIONS_C@ @ASSERT_DEFINITION@ @SUBUNIT_CFLAGS@                             \
        -DMAPISTORE_DBPATH=\"$(prefix)/private/mapistore/mapistore.ldb\"                                        \
        -DMAPISTORE_DB_NAMEDPROPS_PATH=\"$(prefix)/private/mapistore/mapistore_named_properties.ldb\"   \
        -DLZXPRESS_DATADIR=\"$(datadir)/mapitest/lzxpress\"                                             \
-       -DLZFU_DATADIR=\"$(datadir)/mapitest/lzfu\"
+       -DLZFU_DATADIR=\"$(datadir)/mapitest/lzfu\"                                                     \
+       -DHAVE_ICAL_0_46=@have_libical_0_46@
 
 # This value should be determined by configure at some point
 SHLIBEXT=so
index 05808d7965bfd62073a229e4dea1f1a7d8137436..ecb90eb94f68867e94b39ff05374201e96249f54 100644 (file)
@@ -511,6 +511,8 @@ dnl --------------------------------------------------------------------------
 PKG_CHECK_MODULES([ICAL], [libical], [have_libical="yes"], [have_libical="no"])
 AC_SUBST(ICAL_CFLAGS)
 AC_SUBST(ICAL_LIBS)
+PKG_CHECK_MODULES([ICAL_0_46], [libical >= 0.46], [have_libical_0_46="1"], [have_libical_0_46="0"])
+AC_SUBST(have_libical_0_46)
 
 dnl --------------------------------------------------------------------------
 dnl Check for popt
index 8f0011141be4a83943f560ce86993a7d807c5979..d51d92720bf92b5ec891c0430b3b50fab72c28a6 100644 (file)
@@ -125,8 +125,13 @@ void ical_property_ATTACH(struct exchange2ical *exchange2ical)
                                                data=ldb_base64_encode(exchange2ical->mem_ctx, (const char *)body.data, body.length);
                                                
                                                /*Create a new icalattach from above data*/
+#if HAVE_ICAL_0_46
+                                               /* the function signature for icalattach_new_from_data() changed in 0.46, released 2010-08-30 */
+                                               /* we can switch to just using the new signature after everyone has had a reasonable chance to update (say end of 2011) */
+                                               icalattach = icalattach_new_from_data(data, 0, 0);
+#else
                                                icalattach = icalattach_new_from_data((unsigned char *)data,0,0);
-                                               
+#endif
                                                /*Add attach property to vevent component*/
                                                prop = icalproperty_new_attach(icalattach);
                                                icalcomponent_add_property(exchange2ical->vevent, prop);