[build] standardize on -fvisibility=hidden for all targets

Enables -fvisibility=hidden for iOS and Linux, and adds a workaround for GCC 6.3-7.1
Adds a GCC 6 build
Enables diagnostics for C files
Fixes a shadow warning in parsedate.c
This commit is contained in:
Konstantin Käfer
2017-11-29 15:54:40 +01:00
parent 2eec5a1980
commit 8757164ac8
19 changed files with 36 additions and 142 deletions

View File

@@ -418,7 +418,7 @@ static time_t my_timegm(struct my_tm *tm)
{
static const int month_days_cumulative [12] =
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
int month, year, leap_days;
int month_, year, leap_days;
if(tm->tm_year < 70)
/* we don't support years before 1970 as they will cause this function
@@ -426,14 +426,14 @@ static time_t my_timegm(struct my_tm *tm)
return -1;
year = tm->tm_year + 1900;
month = tm->tm_mon;
if(month < 0) {
year += (11 - month) / 12;
month = 11 - (11 - month) % 12;
month_ = tm->tm_mon;
if(month_ < 0) {
year += (11 - month_) / 12;
month_ = 11 - (11 - month_) % 12;
}
else if(month >= 12) {
year -= month / 12;
month = month % 12;
else if(month_ >= 12) {
year -= month_ / 12;
month_ = month_ % 12;
}
leap_days = year - (tm->tm_mon <= 1);
@@ -441,7 +441,7 @@ static time_t my_timegm(struct my_tm *tm)
- (1969 / 4) + (1969 / 100) - (1969 / 400));
return ((((time_t) (year - 1970) * 365
+ leap_days + month_days_cumulative [month] + tm->tm_mday - 1) * 24
+ leap_days + month_days_cumulative [month_] + tm->tm_mday - 1) * 24
+ tm->tm_hour) * 60 + tm->tm_min) * 60 + tm->tm_sec;
}