Bug 394902: bustage fix; r=me
authorDaniel Boelzle [:dbo] <daniel.boelzle@sun.com>
Mon, 27 Oct 2008 14:33:43 +0100
changeset 727 785c708554f781615c434f8a7ede8d9dd04b246f
parent 726 e6eac490c2ddf0611d6c572ec67d407a93703cfc
child 728 92046e4f9f9135674a2d6d81a69a0d2d115a3617
push idunknown
push userunknown
push dateunknown
reviewersme
bugs394902
Bug 394902: bustage fix; r=me
calendar/libical/src/libical/ical_file.cmake
calendar/libical/src/libical/icalcomponent.c
calendar/libical/src/libical/icalduration.c
calendar/libical/src/libical/icalenums.c
calendar/libical/src/libical/icalrecur.c
calendar/libical/src/libical/icalrestriction.c.in
calendar/libical/src/libical/icaltimezone.c
deleted file mode 100644
--- a/calendar/libical/src/libical/ical_file.cmake
+++ /dev/null
@@ -1,49 +0,0 @@
-# ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering.
-# It is required to make the combined header ical.h properly.
-set(COMBINEDHEADERSICAL
-   ${TOPB}/src/libical/icalversion.h
-   ${TOPS}/src/libical/icaltime.h
-   ${TOPS}/src/libical/icalduration.h
-   ${TOPS}/src/libical/icalperiod.h
-   ${TOPS}/src/libical/icalenums.h
-   ${TOPS}/src/libical/icaltypes.h
-   ${TOPS}/src/libical/icalrecur.h
-   ${TOPS}/src/libical/icalattach.h
-   ${TOPB}/src/libical/icalderivedvalue.h
-   ${TOPB}/src/libical/icalderivedparameter.h
-   ${TOPS}/src/libical/icalvalue.h
-   ${TOPS}/src/libical/icalparameter.h
-   ${TOPB}/src/libical/icalderivedproperty.h
-   ${TOPS}/src/libical/icalproperty.h
-   ${TOPS}/src/libical/pvl.h
-   ${TOPS}/src/libical/icalarray.h
-   ${TOPS}/src/libical/icalcomponent.h
-   ${TOPS}/src/libical/icaltimezone.h
-   ${TOPS}/src/libical/icalparser.h
-   ${TOPS}/src/libical/icalmemory.h
-   ${TOPS}/src/libical/icalerror.h
-   ${TOPS}/src/libical/icalrestriction.h
-   ${TOPS}/src/libical/sspm.h
-   ${TOPS}/src/libical/icalmime.h
-   ${TOPS}/src/libical/icallangbind.h
-)
-
-FILE(WRITE  ${ICAL_FILE_H_FILE} "#ifndef LIBICAL_ICAL_H\n")
-FILE(APPEND ${ICAL_FILE_H_FILE} "#define LIBICAL_ICAL_H\n")
-FILE(APPEND ${ICAL_FILE_H_FILE} "#ifdef __cplusplus\n")
-FILE(APPEND ${ICAL_FILE_H_FILE} "extern \"C\" {\n")
-FILE(APPEND ${ICAL_FILE_H_FILE} "#endif\n")
-
-foreach (_current_FILE ${COMBINEDHEADERSICAL})
-   FILE(READ ${_current_FILE} _contents)
-   STRING(REGEX REPLACE "#include *\"ical.*\\.h\"" "" _contents "${_contents}")
-   STRING(REGEX REPLACE "#include *\"config.*\\.h\"" "" _contents "${_contents}")
-   STRING(REGEX REPLACE "#include *\"pvl\\.h\"" "" _contents "${_contents}" )
-   FILE(APPEND ${ICAL_FILE_H_FILE} "${_contents}")
-endforeach (_current_FILE)
-
-FILE(APPEND ${ICAL_FILE_H_FILE} "\n")
-FILE(APPEND ${ICAL_FILE_H_FILE} "#ifdef __cplusplus\n")
-FILE(APPEND ${ICAL_FILE_H_FILE} "}\n")
-FILE(APPEND ${ICAL_FILE_H_FILE} "#endif\n")
-FILE(APPEND ${ICAL_FILE_H_FILE} "#endif\n")
--- a/calendar/libical/src/libical/icalcomponent.c
+++ b/calendar/libical/src/libical/icalcomponent.c
@@ -41,16 +41,20 @@
 
 #include <stdlib.h>  /* for malloc */
 #include <stdarg.h> /* for va_list, etc */
 #include <errno.h>
 #include <assert.h>
 #include <stdio.h> /* for fprintf */
 #include <string.h> /* for strdup */
 #include <limits.h> /* for INT_MAX */
+#ifdef WIN32
+#define snprintf _snprintf
+#define strncasecmp strnicmp
+#endif
 
 struct icalcomponent_impl 
 {
 	char id[5];
 	icalcomponent_kind kind;
 	char* x_name;
 	pvl_list properties;
 	pvl_elem property_iterator;
--- a/calendar/libical/src/libical/icalduration.c
+++ b/calendar/libical/src/libical/icalduration.c
@@ -30,16 +30,19 @@
 #endif
 
 #include "icalduration.h"
 
 #include <assert.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
+#ifdef WIN32
+#define snprintf _snprintf
+#endif
 
 #include "icalerror.h"
 #include "icalmemory.h"
 #include "icalvalue.h"
 
 
 
 
--- a/calendar/libical/src/libical/icalenums.c
+++ b/calendar/libical/src/libical/icalenums.c
@@ -30,16 +30,19 @@
 #endif
 
 #include "icalenums.h"
 
 #include <stdio.h> /* For fprintf */
 #include <stdio.h> /* For stderr */
 #include <string.h> /* For strncmp */
 #include <assert.h>
+#ifdef WIN32
+#define snprintf _snprintf
+#endif
 #include "icalmemory.h"
 
 /*** @brief Allowed request status values
  */
 static const struct {
 	 enum icalrequeststatus kind;
 	int major;
 	int minor;
--- a/calendar/libical/src/libical/icalrecur.c
+++ b/calendar/libical/src/libical/icalrecur.c
@@ -143,17 +143,18 @@
 
 #ifndef HAVE_INTPTR_T
 #if defined (WIN32) || defined (XP_BEOS)
 typedef long intptr_t;
 #endif
 #endif
 
 #ifdef WIN32
-#define strcasecmp      stricmp
+#define snprintf _snprintf
+#define strcasecmp stricmp
 #endif
 
 #include "icalrecur.h"
 
 #include "icalerror.h"
 #include "icalmemory.h"
 
 #include <stdlib.h> /* for malloc */
--- a/calendar/libical/src/libical/icalrestriction.c.in
+++ b/calendar/libical/src/libical/icalrestriction.c.in
@@ -11,16 +11,19 @@
 #endif
 
 #include "icalrestriction.h"
 #include "icalenums.h"
 #include "icalerror.h"
 
 #include <assert.h>
 #include <stdio.h> /* For snprintf */   
+#ifdef WIN32
+#define snprintf _snprintf
+#endif
 
 #define TMP_BUF_SIZE 1024
 
 /* Define the structs for the restrictions. these data are filled out
 in machine generated code below */
 
 struct icalrestriction_property_record;
 
--- a/calendar/libical/src/libical/icaltimezone.c
+++ b/calendar/libical/src/libical/icaltimezone.c
@@ -51,16 +51,19 @@
 #include <windows.h>
 /* Undef the similar macro from pthread.h, it doesn't check if
  * gmtime() returns NULL.
  */
 #undef gmtime_r
 
 /* The gmtime() in Microsoft's C library is MT-safe */
 #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
+
+#define snprintf _snprintf
+#define strcasecmp stricmp
 #endif
 
 /** This is the toplevel directory where the timezone data is installed in. */
 #define ZONEINFO_DIRECTORY	PACKAGE_DATA_DIR "/zoneinfo"
 
 /** The prefix we use to uniquely identify TZIDs. */
 #define TZID_PREFIX		"/citadel.org/"
 #define TZID_PREFIX_LEN		13
@@ -1361,24 +1364,25 @@ icaltimezone_free_builtin_timezones(void
 
 /** Returns a single builtin timezone, given its Olson city name. */
 icaltimezone*
 icaltimezone_get_builtin_timezone	(const char *location)
 {
     icaltimezone *zone;
     unsigned int lower;
     const char *zone_location;
+    icalarray * builtin_timezones;
 
     if (!location || !location[0])
 	return NULL;
 
     if (!strcmp (location, "UTC"))
 	return &utc_timezone;
     
-    icalarray * builtin_timezones = icaltimezone_get_builtin_timezones();
+    builtin_timezones = icaltimezone_get_builtin_timezones();
     if (!builtin_timezones) {
 	return NULL;
     }
 
 #if 0
     /* Do a simple binary search. */
     lower = middle = 0;
     upper = builtin_timezones->num_elements;
@@ -1446,24 +1450,25 @@ get_offset (icaltimezone *zone)
 }
 
 /** Returns a single builtin timezone, given its offset from UTC */
 icaltimezone*
 icaltimezone_get_builtin_timezone_from_offset	(int offset, const char *tzname)
 {
     icaltimezone *zone=NULL;
     int count, i;
-    
+    icalarray * builtin_timezones;
+
     if (offset==0)
 	return &utc_timezone;
 
     if (!tzname)
 	return NULL;
 
-    icalarray * builtin_timezones = icaltimezone_get_builtin_timezones();
+    builtin_timezones = icaltimezone_get_builtin_timezones();
     if (!builtin_timezones) {
 	return NULL;
     }
 
     count = builtin_timezones->num_elements;
 
     for (i=0; i<count; i++) {
 	int z_offset;