]> xenbits.xensource.com Git - libvirt.git/commitdiff
Renamed internal __mon_yday into mon_yday to avoid conflicts
authorCédric Bosdonnat <cbosdonnat@suse.com>
Thu, 18 Sep 2014 21:23:11 +0000 (23:23 +0200)
committerCédric Bosdonnat <cbosdonnat@suse.com>
Tue, 28 Oct 2014 20:44:18 +0000 (14:44 -0600)
libc has another constant with the same name, which leads to
redefinition error when building against static libvirt

src/util/virtime.c

index acbec416352f8c031f27e3b505d6ea3ea49a4687..9d365d51c8b4f6a11ab6a0a76beaf4d0bd952ca3 100644 (file)
@@ -105,7 +105,7 @@ int virTimeFieldsNowRaw(struct tm *fields)
 #define DIV(a, b) ((a) / (b) - ((a) % (b) < 0))
 #define LEAPS_THRU_END_OF(y) (DIV (y, 4) - DIV (y, 100) + DIV (y, 400))
 
-const unsigned short int __mon_yday[2][13] = {
+static const unsigned short int mon_yday[2][13] = {
     /* Normal years.  */
     { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
     /* Leap years.  */
@@ -160,7 +160,7 @@ void virTimeFieldsThen(unsigned long long when, struct tm *fields)
     fields->tm_year = y - 1900;
 
     fields->tm_yday = days;
-    ip = __mon_yday[is_leap_year(y)];
+    ip = mon_yday[is_leap_year(y)];
     for (y = 11; days < (long int) ip[y]; --y)
         continue;
     days -= ip[y];