elm example : on some OS (windows...) struct tm has 9 fields and not 11. Fix warning.

Test Plan: compilation

Reviewers: raster, jpeg

Reviewed By: raster, jpeg

Subscribers: jpeg, cedric, raster

Differential Revision: https://phab.enlightenment.org/D5723
This commit is contained in:
Vincent Torri 2018-01-08 21:10:22 +09:00 committed by Jean-Philippe Andre
parent afcca1584a
commit fcb093473a
1 changed files with 13 additions and 4 deletions

View File

@ -27,12 +27,21 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
Elm_Calendar_Mark *mark;
struct tm selected_time;
time_t current_time;
struct tm sunday = { 0, 0, 12, 7, 0, 0, 0, 0, -1, 0, NULL };
/* tm {sec, min, hour, mday, mon, year, wday, yday, isdst } */
/* weekdays since Sunday, range 0 to 6 */
struct tm sunday;
struct tm christmas;
/*
* At least on Windows, tm has 9 fields.
* As a workaround, set sunday to 0 and set
* th needed fields to correct value
*/
memset(&sunday, 0, sizeof(struct tm));
sunday.tm_hour = 12;
sunday.tm_mday = 7;
sunday.tm_isdst = -1;
memset(&christmas, 0, sizeof(struct tm));
christmas.tm_mday = 25;
/* months since Jan, in the range 0 to 11 */
christmas.tm_mon = 11;
win = elm_win_util_standard_add("calendar", "Calendar Marks Example");