From 532284dbbe4259a9f2291f44d3eff376849e8031 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Thu, 10 Jan 2013 02:18:10 +0000 Subject: [PATCH] efl: forward typedef to avoid including useless headers. do not include Ecore_Input.h just to get Ecore_Window and Ecore_Getopt to get handful typedefs. NOTE: why do we have the #ifdefs around these predefs? At least GCC does not warn if we typedef twice the same thing (if they are identical) SVN revision: 82499 --- src/lib/ecore/Ecore_Getopt.h | 17 +++++++++++++---- src/lib/ecore_evas/Ecore_Evas.h | 2 -- src/lib/ecore_evas/Ecore_Evas_Types.h | 23 +++++++++++++++++++++++ src/lib/ecore_evas/ecore_evas_util.c | 1 + src/lib/ecore_input/Ecore_Input.h | 4 ++++ 5 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/lib/ecore/Ecore_Getopt.h b/src/lib/ecore/Ecore_Getopt.h index 3574ba5bfa..d4ce3aa709 100644 --- a/src/lib/ecore/Ecore_Getopt.h +++ b/src/lib/ecore/Ecore_Getopt.h @@ -86,12 +86,21 @@ typedef enum { ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL = 3 } Ecore_Getopt_Desc_Arg_Requirement; -typedef union _Ecore_Getopt_Value Ecore_Getopt_Value; - typedef struct _Ecore_Getopt_Desc_Store Ecore_Getopt_Desc_Store; typedef struct _Ecore_Getopt_Desc_Callback Ecore_Getopt_Desc_Callback; -typedef struct _Ecore_Getopt_Desc Ecore_Getopt_Desc; -typedef struct _Ecore_Getopt Ecore_Getopt; + +#ifndef _ECORE_GETOPT_PREDEF +typedef struct _Ecore_Getopt Ecore_Getopt; +#define _ECORE_GETOPT_PREDEF 1 +#endif +#ifndef _ECORE_GETOPT_DESC_PREDEF +typedef struct _Ecore_Getopt_Desc Ecore_Getopt_Desc; +#define _ECORE_GETOPT_DESC_PREDEF 1 +#endif +#ifndef _ECORE_GETOPT_VALUE_PREDEF +typedef union _Ecore_Getopt_Value Ecore_Getopt_Value; +#define _ECORE_GETOPT_VALUE_PREDEF 1 +#endif union _Ecore_Getopt_Value { diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h index 9792e07e61..2393e313ee 100644 --- a/src/lib/ecore_evas/Ecore_Evas.h +++ b/src/lib/ecore_evas/Ecore_Evas.h @@ -4,8 +4,6 @@ #include "Ecore_Evas_Types.h" #include -#include -#include #ifdef EAPI # undef EAPI diff --git a/src/lib/ecore_evas/Ecore_Evas_Types.h b/src/lib/ecore_evas/Ecore_Evas_Types.h index 395c4c016f..b819e85adc 100644 --- a/src/lib/ecore_evas/Ecore_Evas_Types.h +++ b/src/lib/ecore_evas/Ecore_Evas_Types.h @@ -1,6 +1,12 @@ #ifndef _ECORE_EVAS_TYPES_H_ #define _ECORE_EVAS_TYPES_H_ +#ifdef _WIN32 +# include +#else +# include +#endif + #ifndef _ECORE_X_H #define _ECORE_X_WINDOW_PREDEF typedef unsigned int Ecore_X_Window; @@ -34,5 +40,22 @@ typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for s typedef struct _Ecore_Wl_Window Ecore_Wl_Window; #endif +#ifndef _ECORE_GETOPT_PREDEF +typedef struct _Ecore_Getopt Ecore_Getopt; +#define _ECORE_GETOPT_PREDEF 1 +#endif +#ifndef _ECORE_GETOPT_DESC_PREDEF +typedef struct _Ecore_Getopt_Desc Ecore_Getopt_Desc; +#define _ECORE_GETOPT_DESC_PREDEF 1 +#endif +#ifndef _ECORE_GETOPT_VALUE_PREDEF +typedef union _Ecore_Getopt_Value Ecore_Getopt_Value; +#define _ECORE_GETOPT_VALUE_PREDEF 1 +#endif + +#ifndef _ECORE_WINDOW_PREDEF +typedef uintptr_t Ecore_Window; +#define _ECORE_WINDOW_PREDEF 1 +#endif #endif /* _ECORE_EVAS_TYPES_H_ */ diff --git a/src/lib/ecore_evas/ecore_evas_util.c b/src/lib/ecore_evas/ecore_evas_util.c index 85ff2bd37f..86745c9be3 100644 --- a/src/lib/ecore_evas/ecore_evas_util.c +++ b/src/lib/ecore_evas/ecore_evas_util.c @@ -6,6 +6,7 @@ #include #include +#include #include "ecore_private.h" #include "ecore_evas_private.h" diff --git a/src/lib/ecore_input/Ecore_Input.h b/src/lib/ecore_input/Ecore_Input.h index d1feb220e1..ec40af8062 100644 --- a/src/lib/ecore_input/Ecore_Input.h +++ b/src/lib/ecore_input/Ecore_Input.h @@ -61,7 +61,11 @@ extern "C" { #define ECORE_EVENT_LOCK_SHIFT 0x0300 #define ECORE_EVENT_MODIFIER_ALTGR 0x0400 /**< @since 1.7 */ +#ifndef _ECORE_WINDOW_PREDEF typedef uintptr_t Ecore_Window; +#define _ECORE_WINDOW_PREDEF 1 +#endif + typedef struct _Ecore_Event_Key Ecore_Event_Key; typedef struct _Ecore_Event_Mouse_Button Ecore_Event_Mouse_Button; typedef struct _Ecore_Event_Mouse_Wheel Ecore_Event_Mouse_Wheel;