From e130557be7491f78b73dc4845a731c283f71a511 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sat, 15 Jul 2017 10:07:39 +0900 Subject: [PATCH] Revert "reduce include deps for enlightenment_imc binary" This reverts commit ee71ea63ec02a1bd7acfb11d9dea38eb3e499147. Revert "reduce include deps for enlightenment_thumb binary" This reverts commit cce14fa8399afd3f8e244a2fb216ae4e5d50b942. both of these i reverted.... because they both CHANGE the define of E_API like: and this is wrong. e.h defines this so that these symbols are exposed. E_API, EAPI and friends are desighned to explicitly expose symbols. because if you try and make STRICTER binaries that only have symbols for what was EXPLICTLY exposed like the CFLAG -fvisibility=hidden ... then any api not explicitly marked with the attribute of visible which that E_API macro is intended for... will be invisible. it will not exist. this means a whole MOUNTAIN of modules stop loading as they can't find these symbols. E_API isn't just source sugar tagging. it's actually functional. i'd suggest using -fvisibility=hidden in your CFLAGS by default. it's also not always portable between all compilers so beware... (it was introduced years ago in gcc... i think clang offers it. i don't know about icc or any others). so since E_API is defined in e.h ... we may as well keep the e.h include there instead of hand re-writing a list of includes. does reducing the include deps really have an impact worth talking about on compile time? the commit logs didn't say. but it does break module loading and does it by adding lots of lines of code that are far mroe easily broken now (this is an examplt). :) --- src/bin/e_config_data.c | 10 +--------- src/bin/e_imc_main.c | 19 ++----------------- src/bin/e_intl_data.c | 17 ++--------------- src/bin/e_sha1.c | 9 +-------- src/bin/e_user.c | 12 +----------- 5 files changed, 7 insertions(+), 60 deletions(-) diff --git a/src/bin/e_config_data.c b/src/bin/e_config_data.c index bb1b6c865..8dd90339f 100644 --- a/src/bin/e_config_data.c +++ b/src/bin/e_config_data.c @@ -1,12 +1,4 @@ -#include -#include -#define E_TYPEDEFS -#include "e_config_data.h" -#undef E_TYPEDEFS -#ifndef E_API -# define E_API -#endif -#include "e_config_data.h" +#include "e.h" static Eina_Hash *config_hash = NULL; diff --git a/src/bin/e_imc_main.c b/src/bin/e_imc_main.c index 563dbab7e..8c5adc296 100644 --- a/src/bin/e_imc_main.c +++ b/src/bin/e_imc_main.c @@ -1,19 +1,4 @@ -#include -#include -#include -#define E_TYPEDEFS -#include "e_config_data.h" -#include "e_intl_data.h" -#undef E_TYPEDEFS -#ifndef E_API -# define E_API -#endif -#ifndef EINTERN -# define EINTERN -#endif -#include "e_config_data.h" -#include "e_intl_data.h" - +#include "e.h" static void _e_help(void); @@ -196,7 +181,7 @@ main(int argc, char **argv) } e_intl_input_method_config_free(read_imc); - free(write_imc); + E_FREE(write_imc); eet_close(ef); e_intl_data_shutdown(); eet_shutdown(); diff --git a/src/bin/e_intl_data.c b/src/bin/e_intl_data.c index 5580a3e22..bd02c8110 100644 --- a/src/bin/e_intl_data.c +++ b/src/bin/e_intl_data.c @@ -1,17 +1,4 @@ -#include -#include -#define E_TYPEDEFS -#include "e_config_data.h" -#include "e_intl_data.h" -#undef E_TYPEDEFS -#ifndef E_API -# define E_API -#endif -#ifndef EINTERN -# define EINTERN -#endif -#include "e_config_data.h" -#include "e_intl_data.h" +#include "e.h" /* This file is the counterpart for data storage of e_intl */ /* This only needs to be separate because the e_imc binary and other third parties @@ -82,7 +69,7 @@ e_intl_input_method_config_free(E_Input_Method_Config *imc) if (imc->ecore_imf_module) eina_stringshare_del(imc->ecore_imf_module); if (imc->e_im_exec) eina_stringshare_del(imc->e_im_exec); if (imc->e_im_setup_exec) eina_stringshare_del(imc->e_im_setup_exec); - free(imc); + E_FREE(imc); } } diff --git a/src/bin/e_sha1.c b/src/bin/e_sha1.c index 031ae378a..375b26477 100644 --- a/src/bin/e_sha1.c +++ b/src/bin/e_sha1.c @@ -1,13 +1,6 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "e.h" #include -#ifndef E_API -#define E_API -#endif - - #ifdef HAVE_ARPA_INET_H # include #endif diff --git a/src/bin/e_user.c b/src/bin/e_user.c index 5db97b5a7..e79717a6a 100644 --- a/src/bin/e_user.c +++ b/src/bin/e_user.c @@ -1,14 +1,4 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include - -#ifndef E_API -#define E_API -#endif +#include "e.h" static const char *_e_user_homedir = NULL; static size_t _e_user_homedir_len = 0;