Fix patching of installation date

Marking qt_eval_expiry_date alone as volatile apparently didn't stop
the compiler from optimizing away the calculation of the expiry date.

Task-number: QTBUG-41612
Change-Id: Ia51fb83f03250346952a76c8a1a641096b4ff9e7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Kalle Viironen <kalle.viironen@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
This commit is contained in:
Kai Koehne 2014-09-29 15:30:08 +02:00
parent 0647f24c7d
commit 01f5ba006e

View File

@ -111,10 +111,11 @@ static EvaluationStatus qt_eval_is_supported()
static int qt_eval_days_left()
{
const char *expiry_date = const_cast<const char*>(qt_eval_expiry_date + 12);
const volatile char *const expiry_date = qt_eval_expiry_date + 12;
QDate today = QDate::currentDate();
QDate lastday = QDate::fromString(QString::fromLatin1(expiry_date), Qt::ISODate);
QDate lastday = QDate::fromString(
QString::fromLatin1(const_cast<const char*>(expiry_date)), Qt::ISODate);
return today.daysTo(lastday);
}