ecore: Fix compilation for GCC 4
authorLauro Moura <lauromoura@expertisesolutions.com.br>
Tue, 7 Nov 2017 20:01:56 +0000 (17:01 -0300)
committerLauro Moura <lauromoura@expertisesolutions.com.br>
Mon, 4 Dec 2017 18:47:52 +0000 (15:47 -0300)
Summary:
GCC4 support compound literals for static initializers only in C89. This
commit reverts to the previous behavior when using this version.

Currently we are using it to build on Windows.

Reviewers: felipealmeida, cedric, barbieri

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5518

src/lib/ecore/ecore_main.c

index e0099f0..a854397 100644 (file)
@@ -285,7 +285,12 @@ int in_main_loop = 0;
 
 static Eina_List *_pending_futures = NULL;
 static Eina_List *_pending_promises = NULL;
+#if (defined __GNUC__) && (__GNUC__ <= 4)
+// GCC 4 does not support compound literal for statics initializers in C99
+static Eina_Value _ecore_exit_code = {0};
+# else
 static Eina_Value _ecore_exit_code = EINA_VALUE_EMPTY;
+#endif
 static int do_quit = 0;
 static Ecore_Fd_Handler *fd_handlers = NULL;
 static Ecore_Fd_Handler *fd_handler_current = NULL;