jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4c44890872034d85dc1d4cf1d3506d5bafbd806c

commit 4c44890872034d85dc1d4cf1d3506d5bafbd806c
Author: Vincent Torri <vincent.to...@gmail.com>
Date:   Mon Jan 8 21:10:22 2018 +0900

    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
---
 src/examples/elementary/calendar_example_06.c | 17 +++++++++++++----
 1 file 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)
    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");

-- 


Reply via email to