summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2018-01-08 21:10:22 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2018-01-08 21:10:22 +0900
commit4c44890872034d85dc1d4cf1d3506d5bafbd806c (patch)
treee26c38963619d2e2a4ce8a213af58592a52bf640
parentd838220d5671875eaef1dcea9dd024cc126360e0 (diff)
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
-rw-r--r--src/examples/elementary/calendar_example_06.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/examples/elementary/calendar_example_06.c b/src/examples/elementary/calendar_example_06.c
index 61e46a259c..6e25bb87a8 100644
--- a/src/examples/elementary/calendar_example_06.c
+++ b/src/examples/elementary/calendar_example_06.c
@@ -27,12 +27,21 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
27 Elm_Calendar_Mark *mark; 27 Elm_Calendar_Mark *mark;
28 struct tm selected_time; 28 struct tm selected_time;
29 time_t current_time; 29 time_t current_time;
30 struct tm sunday = { 0, 0, 12, 7, 0, 0, 0, 0, -1, 0, NULL }; 30 struct tm sunday;
31 /* tm {sec, min, hour, mday, mon, year, wday, yday, isdst } */
32 /* weekdays since Sunday, range 0 to 6 */
33 struct tm christmas; 31 struct tm christmas;
32
33 /*
34 * At least on Windows, tm has 9 fields.
35 * As a workaround, set sunday to 0 and set
36 * th needed fields to correct value
37 */
38 memset(&sunday, 0, sizeof(struct tm));
39 sunday.tm_hour = 12;
40 sunday.tm_mday = 7;
41 sunday.tm_isdst = -1;
42
43 memset(&christmas, 0, sizeof(struct tm));
34 christmas.tm_mday = 25; 44 christmas.tm_mday = 25;
35 /* months since Jan, in the range 0 to 11 */
36 christmas.tm_mon = 11; 45 christmas.tm_mon = 11;
37 46
38 win = elm_win_util_standard_add("calendar", "Calendar Marks Example"); 47 win = elm_win_util_standard_add("calendar", "Calendar Marks Example");