[packages] php5: fix compilation without CONFIG_PHP5_SYSTEMTZDATA selected
[packages.git] / lang / php5 / patches / 102-debian_patches_use_embedded_timezonedb.patch
index c27fa9d..390910f 100644 (file)
@@ -3,6 +3,7 @@ Add support for use of the system timezone database, rather
 than embedding a copy.  Discussed upstream but was not desired.
 
 History:
+r9: fix another compile error without --with-system-tzdata configured
 r8: fix compile error without --with-system-tzdata configured
 r7: improve check for valid timezone id to exclude directories
 r6: fix fd leak in r5, fix country code/BC flag use in 
@@ -66,7 +67,7 @@ r1: initial revision
        /* read BC flag */
        tz->bc = (**tzf == '\1');
        *tzf += 1;
-@@ -256,7 +276,397 @@ void timelib_dump_tzinfo(timelib_tzinfo
+@@ -256,7 +276,397 @@
        }
  }
  
@@ -465,7 +466,7 @@ r1: initial revision
  {
        int left = 0, right = tzdb->index_size - 1;
  #ifdef HAVE_SETLOCALE
-@@ -295,36 +705,125 @@ static int seek_to_tz_position(const uns
+@@ -295,36 +705,128 @@
        return 0;
  }
  
@@ -473,6 +474,7 @@ r1: initial revision
 +                             char **map, size_t *maplen,
 +                             const timelib_tzdb *tzdb)
 +{
++#ifdef HAVE_SYSTEM_TZDATA
 +      if (tzdb == timezonedb_system) {
 +              char *orig;
 +
@@ -486,7 +488,9 @@ r1: initial revision
 +                
 +                return 1;
 +      }
-+      else {
++      else
++#endif
++      {
 +              return inmem_seek_to_tz_position(tzf, timezone, tzdb);
 +      }
 +}
@@ -596,7 +600,7 @@ r1: initial revision
        }
 --- a/ext/date/lib/timelib.m4
 +++ b/ext/date/lib/timelib.m4
-@@ -78,3 +78,17 @@ stdlib.h
+@@ -78,3 +78,17 @@
  
  dnl Check for strtoll, atoll
  AC_CHECK_FUNCS(strtoll atoll strftime)