From: mquinson Date: Thu, 20 Dec 2007 07:42:18 +0000 (+0000) Subject: Improve compilation time by epsilon by sharpening the includes (str.h loads dynar... X-Git-Tag: v3.3~711 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/be24a421768041ffd250dc4dc68a285f0b59b88f Improve compilation time by epsilon by sharpening the includes (str.h loads dynar.h and a whole bunch of cruft, so do not load str.h from sysdep.h which is basically loaded by everyone) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5140 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/xbt/sysdep.h b/include/xbt/sysdep.h index a2271ab4b1..8faa0da4b9 100644 --- a/include/xbt/sysdep.h +++ b/include/xbt/sysdep.h @@ -17,7 +17,6 @@ #include "xbt/misc.h" #include "xbt/asserts.h" -#include "xbt/str.h" SG_BEGIN_DECL() @@ -32,6 +31,12 @@ XBT_PUBLIC(void) xbt_abort(void) _XBT_GNUC_NORETURN; XBT_PUBLIC(void) xbt_die(const char *msg) _XBT_GNUC_NORETURN; /** @} */ +/* these ones live in str.h, but redeclare them here so that we do + not need to load the whole str.h and its heavy dependencies */ +XBT_PUBLIC(int) asprintf (char **ptr, const char *fmt, /*args*/ ...) _XBT_GNUC_PRINTF(2,3); +XBT_PUBLIC(int) vasprintf (char **ptr, const char *fmt, va_list ap); +XBT_PUBLIC(char*) bprintf (const char*fmt, ...) _XBT_GNUC_PRINTF(1,2); + /** @addtogroup XBT_syscall * @brief Malloc and associated functions, killing the program on error (with \ref XBT_ex) * diff --git a/src/simdag/sd_global.c b/src/simdag/sd_global.c index df22d65a14..ee029e07bf 100644 --- a/src/simdag/sd_global.c +++ b/src/simdag/sd_global.c @@ -4,6 +4,7 @@ #include "surf/surf.h" #include "xbt/ex.h" #include "xbt/log.h" +#include "xbt/str.h" #include "xbt/config.h" XBT_LOG_NEW_CATEGORY(sd,"Logging specific to SimDag"); diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index c204eca673..192a816082 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -9,6 +9,7 @@ #include "private.h" #include "xbt/sysdep.h" #include "xbt/log.h" +#include "xbt/str.h" #include "xbt/ex.h" /* ex_backtrace_display */ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix, "Logging specific to SIMIX (kernel)"); diff --git a/src/surf/cpu_private.h b/src/surf/cpu_private.h index 63017a446d..0e91cb59fb 100644 --- a/src/surf/cpu_private.h +++ b/src/surf/cpu_private.h @@ -10,6 +10,7 @@ #include "surf_private.h" #include "xbt/dict.h" +#include "xbt/str.h" typedef struct surf_action_cpu_Cas01 { s_surf_action_t generic_action; diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 736792a912..008d394d23 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -7,6 +7,7 @@ #include "xbt/misc.h" #include "xbt/log.h" +#include "xbt/str.h" #include "xbt/dict.h" #include "surf/surfxml_parse_private.h" #include "surf/surf_private.h" diff --git a/src/surf/trace_mgr.c b/src/surf/trace_mgr.c index 65a9259c2d..1f53504f00 100644 --- a/src/surf/trace_mgr.c +++ b/src/surf/trace_mgr.c @@ -7,6 +7,7 @@ #include "xbt/sysdep.h" #include "xbt/log.h" +#include "xbt/str.h" #include "xbt/dict.h" #include "trace_mgr_private.h" #include "surf_private.h" diff --git a/src/surf/workstation_ptask_L07.c b/src/surf/workstation_ptask_L07.c index d708a9e1ad..2298b43a4c 100644 --- a/src/surf/workstation_ptask_L07.c +++ b/src/surf/workstation_ptask_L07.c @@ -6,6 +6,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "xbt/ex.h" +#include "xbt/str.h" #include "xbt/dict.h" #include "surf_private.h" /* extern lmm_system_t maxmin_system; */ diff --git a/src/xbt/ex.c b/src/xbt/ex.c index c331605171..428080b406 100644 --- a/src/xbt/ex.c +++ b/src/xbt/ex.c @@ -16,6 +16,7 @@ #include "portable.h" /* execinfo when available */ #include "xbt/ex.h" +#include "xbt/str.h" #include "xbt/module.h" /* xbt_binary_name */ #include "xbt/synchro.h" /* xbt_thread_self */ diff --git a/src/xbt/log.c b/src/xbt/log.c index 19e09b73eb..e80361a07b 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -19,6 +19,7 @@ #include "xbt/misc.h" #include "xbt/ex.h" +#include "xbt/str.h" #include "xbt/sysdep.h" #include "xbt/log_private.h" #include "xbt/dynar.h" diff --git a/src/xbt/xbt_str.c b/src/xbt/xbt_str.c index 805adab4be..6e4739bd37 100644 --- a/src/xbt/xbt_str.c +++ b/src/xbt/xbt_str.c @@ -383,6 +383,8 @@ xbt_dynar_t xbt_str_split_quoted(const char *s) { } #ifdef SIMGRID_TEST +#include "xbt/str.h" + #define mytest(name, input, expected) \ xbt_test_add0(name); \ d=xbt_str_split_quoted(input); \ diff --git a/src/xbt_str_unit.c b/src/xbt_str_unit.c index ecf9026d11..71b2c57065 100644 --- a/src/xbt_str_unit.c +++ b/src/xbt_str_unit.c @@ -9,6 +9,8 @@ /*******************************/ # 387 "xbt/xbt_str.c" +#include "xbt/str.h" + #define mytest(name, input, expected) \ xbt_test_add0(name); \ d=xbt_str_split_quoted(input); \