From: Martin Quinson Date: Wed, 9 Mar 2016 08:55:35 +0000 (+0100) Subject: empty portable.h and spread the include in files X-Git-Tag: v3_13~453^2~23 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/83339f7ee7c47e16583c280915b853a98c59b923 empty portable.h and spread the include in files I did only what I can test to work on my machine so far (ie, all but windows stuff) --- diff --git a/include/xbt/sysdep.h b/include/xbt/sysdep.h index fa2012a84b..9141c69362 100644 --- a/include/xbt/sysdep.h +++ b/include/xbt/sysdep.h @@ -60,10 +60,6 @@ XBT_LOG_EXTERNAL_CATEGORY(xbt); * @{ */ -#if defined(_MSC_VER) && !defined(strdup) -# define strdup _strdup /* POSIX name is not ANSI complient blabla */ -#endif - /** @brief Like strdup, but xbt_die() on error */ static XBT_ALWAYS_INLINE char *xbt_strdup(const char *s) { char *res = NULL; diff --git a/src/mc/mc_checkpoint.cpp b/src/mc/mc_checkpoint.cpp index 3e9a705c9f..b92e233006 100644 --- a/src/mc/mc_checkpoint.cpp +++ b/src/mc/mc_checkpoint.cpp @@ -6,6 +6,7 @@ #include +#include #include #include #include diff --git a/src/mc/mc_dwarf.cpp b/src/mc/mc_dwarf.cpp index 7a754a496f..dc7736a29a 100644 --- a/src/mc/mc_dwarf.cpp +++ b/src/mc/mc_dwarf.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #define DW_LANG_Objc DW_LANG_ObjC /* fix spelling error in older dwarf.h */ #include diff --git a/src/mc/mc_unw_vmread.cpp b/src/mc/mc_unw_vmread.cpp index 45e767b592..e3fba7860c 100644 --- a/src/mc/mc_unw_vmread.cpp +++ b/src/mc/mc_unw_vmread.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include diff --git a/src/mc/simgrid_mc.cpp b/src/mc/simgrid_mc.cpp index c05d0ae4ee..1d19bc56e3 100644 --- a/src/mc/simgrid_mc.cpp +++ b/src/mc/simgrid_mc.cpp @@ -12,6 +12,7 @@ #include +#include #include #include diff --git a/src/portable.h b/src/portable.h index 486687118a..c3ece3fe7f 100644 --- a/src/portable.h +++ b/src/portable.h @@ -11,19 +11,10 @@ #include "simgrid_config.h" /* what was compiled in? */ #include "src/internal_config.h" /* some information about the environment */ -#include "xbt/base.h" -#include "xbt/misc.h" #ifdef _WIN32 # include #endif -#include -#include - -#ifdef HAVE_UNISTD_H -# include -#endif - #ifdef HAVE_SYS_PARAM_H # include #endif @@ -32,49 +23,10 @@ #endif /* File handling */ - -#include - #ifdef _WIN32 - #ifndef EWOULDBLOCK - #define EWOULDBLOCK WSAEWOULDBLOCK - #endif - - #ifndef EINPROGRESS - #define EINPROGRESS WSAEINPROGRESS - #endif - - #ifndef ETIMEDOUT - #define ETIMEDOUT WSAETIMEDOUT - #endif - #ifdef S_IRGRP #undef S_IRGRP #endif #define S_IRGRP 0 - - #ifdef S_IWGRP - #undef S_IWGRP - #endif - #define S_IWGRP 0 -#endif - -#ifndef O_BINARY -# define O_BINARY 0 -#endif - -/* Time handling */ -#include -#include - -/* Signals */ -#ifdef HAVE_SIGNAL_H -# include #endif - -/* What we need to extract the backtrace in exception handling code */ -#ifdef HAVE_EXECINFO_H -# include -#endif - #endif /* SIMGRID_PORTABLE_H */ diff --git a/src/simix/smx_private.h b/src/simix/smx_private.h index 938b5d4614..d6c81dff62 100644 --- a/src/simix/smx_private.h +++ b/src/simix/smx_private.h @@ -26,6 +26,8 @@ #include "popping_private.h" #include "smx_synchro_private.h" +#include + #ifdef __cplusplus #include diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index 2d74f70d58..080e5e2548 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -10,6 +10,7 @@ #include "surf/surf.h" #include "surf/maxmin.h" #include "src/surf/trace_mgr.hpp" +#include #define NO_MAX_DURATION -1.0 diff --git a/src/xbt/backtrace_linux.c b/src/xbt/backtrace_linux.c index 5bdd34cd5b..a1a09e1284 100644 --- a/src/xbt/backtrace_linux.c +++ b/src/xbt/backtrace_linux.c @@ -7,6 +7,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include #include #include diff --git a/src/xbt/cunit.c b/src/xbt/cunit.c index 5235db6c9e..550eb9ea8d 100644 --- a/src/xbt/cunit.c +++ b/src/xbt/cunit.c @@ -10,6 +10,7 @@ /* At some point we should use https://github.com/google/googletest instead */ #include "src/portable.h" +#include #include "xbt/sysdep.h" /* bvprintf */ #include "xbt/cunit.h" diff --git a/src/xbt/xbt_log_layout_format.c b/src/xbt/xbt_log_layout_format.c index b40d634cf5..d1931aaffb 100644 --- a/src/xbt/xbt_log_layout_format.c +++ b/src/xbt/xbt_log_layout_format.c @@ -16,6 +16,10 @@ #include "surf/surf.h" #include +#ifdef HAVE_EXECINFO_H +# include /* Function backtrace */ +#endif + extern const char *xbt_log_priority_names[8]; static double format_begin_of_time = -1; diff --git a/src/xbt/xbt_main.c b/src/xbt/xbt_main.c index 52ec606361..be770f2a16 100644 --- a/src/xbt/xbt_main.c +++ b/src/xbt/xbt_main.c @@ -8,9 +8,9 @@ #define XBT_LOG_LOCALLY_DEFINE_XBT_CHANNEL /* MSVC don't want it to be declared extern in headers and local here */ + #include "xbt/misc.h" #include "simgrid_config.h" -#include "src/portable.h" #include "xbt/sysdep.h" #include "xbt/log.h" #include "xbt/dynar.h" @@ -22,10 +22,14 @@ #include "simgrid/sg_config.h" +#include "src/portable.h" #include #ifdef _WIN32 #include /* To silence MSVC on abort() */ #endif +#ifdef HAVE_UNISTD_H +# include +#endif XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling"); diff --git a/src/xbt/xbt_os_time.c b/src/xbt/xbt_os_time.c index 836bd17724..204d3573c7 100644 --- a/src/xbt/xbt_os_time.c +++ b/src/xbt/xbt_os_time.c @@ -1,16 +1,17 @@ /* xbt_os_time.c -- portable interface to time-related functions */ -/* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include "src/internal_config.h" #include "xbt/sysdep.h" -#include "xbt/xbt_os_time.h" /* this module */ #include "xbt/log.h" -#include "src/portable.h" +#include "xbt/xbt_os_time.h" /* this module */ #include /* floor */ +#include +#include #ifdef _WIN32 #include diff --git a/teshsuite/simdag/platforms/Evaluate_parse_time.c b/teshsuite/simdag/platforms/Evaluate_parse_time.c index 08fa38bed3..e635574016 100644 --- a/teshsuite/simdag/platforms/Evaluate_parse_time.c +++ b/teshsuite/simdag/platforms/Evaluate_parse_time.c @@ -7,6 +7,11 @@ //teshsuite/simdag/platforms/evaluate_parse_time ../examples/platforms/nancy.xml #include +#include "src/internal_config.h" +#ifdef HAVE_UNISTD_H +# include +#endif + #include "simgrid/simdag.h" #include "surf/surf.h" #include "xbt/xbt_os_time.h"