From: <svn...@op...> - 2009-04-08 20:47:58
|
Author: cdfrey Date: Wed Apr 8 22:47:51 2009 New Revision: 5567 URL: http://www.opensync.org/changeset/5567 Log: Define HANDLE_LIBICAL_MEMORY, with safeguards, to avoid compiler warning Modified: plugins/evolution2/src/evolution2_sync.h plugins/evolution2/tools/list_sources.c plugins/evolution2/tools/test_uri.c Modified: plugins/evolution2/src/evolution2_sync.h ============================================================================== --- plugins/evolution2/src/evolution2_sync.h Wed Apr 8 22:22:24 2009 (r5566) +++ plugins/evolution2/src/evolution2_sync.h Wed Apr 8 22:47:51 2009 (r5567) @@ -1,7 +1,26 @@ #ifndef EVO2_SYNC_H #define EVO2_SYNC_H -//#include "evo2_sync.h" +// +// Some versions of libical use a ring buffer for the following +// functions, for which the library manages memory. Somewhere along +// the line, this was fixed so that the application was responsible +// for freeing the strings returned by these functions. A warning +// was added to the header that would display if HANDLE_LIBICAL_MEMORY +// was not defined. +// +// Even newer versions of evolution-data-server, which this plugin +// depends on, get rid of some of these functions, while newer +// versions of libical add _r variants that implement the +// application-free functinality. +// +// Since this plugin does not use these functions, we disable the +// warning by defining HANDLE_LIBICAL_MEMORY, then include the +// headers, and then purposely break the troublesome functions +// so that if a programmer tries to use them later on, he'll know +// to handle them with care. +// +#define HANDLE_LIBICAL_MEMORY 1 #include <opensync/opensync.h> @@ -9,6 +28,18 @@ #include <libebook/e-book.h> #include <libedataserver/e-data-server-util.h> +#define icalreqstattype_as_string() See_evolution2_sync_h_for_note +#define icalproperty_as_ical_string() See_evolution2_sync_h_for_note +#define icalproperty_get_parameter_as_string() See_evolution2_sync_h_for_note +#define icalproperty_get_value_as_string() See_evolution2_sync_h_for_note +#define icallangbind_property_eval_string() See_evolution2_sync_h_for_note +#define icalperiodtype_as_ical_string() See_evolution2_sync_h_for_note +#define icaltime_as_ical_string() See_evolution2_sync_h_for_note +#define icalvalue_as_ical_string() See_evolution2_sync_h_for_note +#define icalcomponent_as_ical_string() See_evolution2_sync_h_for_note +#define e_cal_component_get_recurid_as_string() See_evolution2_sync_h_for_note + + typedef struct evo2_location { char *name; char *uri; Modified: plugins/evolution2/tools/list_sources.c ============================================================================== --- plugins/evolution2/tools/list_sources.c Wed Apr 8 22:22:24 2009 (r5566) +++ plugins/evolution2/tools/list_sources.c Wed Apr 8 22:47:51 2009 (r5567) @@ -1,3 +1,5 @@ +// see note in ../src/evolution2_sync.h +#define HANDLE_LIBICAL_MEMORY 1 #include <glib.h> #include <libecal/e-cal.h> #include <libebook/e-book.h> Modified: plugins/evolution2/tools/test_uri.c ============================================================================== --- plugins/evolution2/tools/test_uri.c Wed Apr 8 22:22:24 2009 (r5566) +++ plugins/evolution2/tools/test_uri.c Wed Apr 8 22:47:51 2009 (r5567) @@ -1,3 +1,5 @@ +// see note in ../src/evolution2_sync.h +#define HANDLE_LIBICAL_MEMORY 1 #include <string.h> #include <glib.h> #include <libecal/e-cal.h> |