Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
empty portable.h and spread the include in files
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 9 Mar 2016 08:55:35 +0000 (09:55 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 9 Mar 2016 08:55:41 +0000 (09:55 +0100)
I did only what I can test to work on my machine so far (ie, all but
windows stuff)

14 files changed:
include/xbt/sysdep.h
src/mc/mc_checkpoint.cpp
src/mc/mc_dwarf.cpp
src/mc/mc_unw_vmread.cpp
src/mc/simgrid_mc.cpp
src/portable.h
src/simix/smx_private.h
src/surf/surf_private.h
src/xbt/backtrace_linux.c
src/xbt/cunit.c
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_main.c
src/xbt/xbt_os_time.c
teshsuite/simdag/platforms/Evaluate_parse_time.c

index fa2012a..9141c69 100644 (file)
@@ -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;
 /** @brief Like strdup, but xbt_die() on error */
 static XBT_ALWAYS_INLINE char *xbt_strdup(const char *s) {
   char *res = NULL;
index 3e9a705..b92e233 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <unistd.h>
 
 
 #include <unistd.h>
 
+#include <fcntl.h>
 #include <string.h>
 #include <link.h>
 #include <dirent.h>
 #include <string.h>
 #include <link.h>
 #include <dirent.h>
index 7a754a4..dc7736a 100644 (file)
@@ -11,6 +11,7 @@
 #include <memory>
 #include <utility>
 
 #include <memory>
 #include <utility>
 
+#include <fcntl.h>
 #include <cstdlib>
 #define DW_LANG_Objc DW_LANG_ObjC       /* fix spelling error in older dwarf.h */
 #include <dwarf.h>
 #include <cstdlib>
 #define DW_LANG_Objc DW_LANG_ObjC       /* fix spelling error in older dwarf.h */
 #include <dwarf.h>
index 45e767b..e3fba78 100644 (file)
@@ -7,6 +7,7 @@
 #include <sys/types.h>
 #include <sys/uio.h>
 
 #include <sys/types.h>
 #include <sys/uio.h>
 
+#include <fcntl.h>
 #include <libunwind.h>
 #include <libunwind-ptrace.h>
 
 #include <libunwind.h>
 #include <libunwind-ptrace.h>
 
index c05d0ae..1d19bc5 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <utility>
 
 
 #include <utility>
 
+#include <fcntl.h>
 #include <signal.h>
 #include <poll.h>
 
 #include <signal.h>
 #include <poll.h>
 
index 4866871..c3ece3f 100644 (file)
 #include "simgrid_config.h"       /* what was compiled in? */
 #include "src/internal_config.h"  /* some information about the environment */
 
 #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 <windows.h>
 #endif
 
 #ifdef _WIN32
 # include <windows.h>
 #endif
 
-#include <stdarg.h>
-#include <stdio.h>
-
-#ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-#endif
-
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
 #endif
 
 /* File handling */
 #endif
 
 /* File handling */
-
-#include <fcntl.h>
-
 #ifdef _WIN32
 #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_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 <sys/time.h>
-#include <time.h>
-
-/* Signals */
-#ifdef HAVE_SIGNAL_H
-# include <signal.h>
 #endif
 #endif
-
-/* What we need to extract the backtrace in exception handling code */
-#ifdef HAVE_EXECINFO_H
-#  include <execinfo.h>
-#endif
-
 #endif                          /* SIMGRID_PORTABLE_H */
 #endif                          /* SIMGRID_PORTABLE_H */
index 938b5d4..d6c81df 100644 (file)
@@ -26,6 +26,8 @@
 #include "popping_private.h"
 #include "smx_synchro_private.h"
 
 #include "popping_private.h"
 #include "smx_synchro_private.h"
 
+#include <signal.h>
+
 #ifdef __cplusplus
 
 #include <simgrid/simix.hpp>
 #ifdef __cplusplus
 
 #include <simgrid/simix.hpp>
index 2d74f70..080e5e2 100644 (file)
@@ -10,6 +10,7 @@
 #include "surf/surf.h"
 #include "surf/maxmin.h"
 #include "src/surf/trace_mgr.hpp"
 #include "surf/surf.h"
 #include "surf/maxmin.h"
 #include "src/surf/trace_mgr.hpp"
+#include <stdio.h>
 
 #define NO_MAX_DURATION -1.0
 
 
 #define NO_MAX_DURATION -1.0
 
index 5bdd34c..a1a09e1 100644 (file)
@@ -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. */
 
 /* 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 <unistd.h>
 #include <execinfo.h>
 #include <sys/stat.h>
 
 #include <execinfo.h>
 #include <sys/stat.h>
 
index 5235db6..550eb9e 100644 (file)
@@ -10,6 +10,7 @@
 /* At some point we should use https://github.com/google/googletest instead */
 
 #include "src/portable.h"
 /* At some point we should use https://github.com/google/googletest instead */
 
 #include "src/portable.h"
+#include <stdio.h>
 
 #include "xbt/sysdep.h"         /* bvprintf */
 #include "xbt/cunit.h"
 
 #include "xbt/sysdep.h"         /* bvprintf */
 #include "xbt/cunit.h"
index b40d634..d1931aa 100644 (file)
 #include "surf/surf.h"
 #include <stdio.h>
 
 #include "surf/surf.h"
 #include <stdio.h>
 
+#ifdef HAVE_EXECINFO_H
+#  include <execinfo.h> /* Function backtrace */
+#endif
+
 extern const char *xbt_log_priority_names[8];
 
 static double format_begin_of_time = -1;
 extern const char *xbt_log_priority_names[8];
 
 static double format_begin_of_time = -1;
index 52ec606..be770f2 100644 (file)
@@ -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 */
 
 
 #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 "xbt/misc.h"
 #include "simgrid_config.h"
-#include "src/portable.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dynar.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dynar.h"
 
 #include "simgrid/sg_config.h"
 
 
 #include "simgrid/sg_config.h"
 
+#include "src/portable.h"
 #include <stdio.h>
 #ifdef _WIN32
 #include <signal.h> /* To silence MSVC on abort() */
 #endif
 #include <stdio.h>
 #ifdef _WIN32
 #include <signal.h> /* To silence MSVC on abort() */
 #endif
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling");
 
index 836bd17..204d357 100644 (file)
@@ -1,16 +1,17 @@
 /* xbt_os_time.c -- portable interface to time-related functions            */
 
 /* 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. */
 
 
 /* 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/sysdep.h"
-#include "xbt/xbt_os_time.h"    /* this module */
 #include "xbt/log.h"
 #include "xbt/log.h"
-#include "src/portable.h"
+#include "xbt/xbt_os_time.h"    /* this module */
 #include <math.h>               /* floor */
 #include <math.h>               /* floor */
+#include <sys/time.h>
+#include <time.h>
 
 #ifdef _WIN32
 #include <sys/timeb.h>
 
 #ifdef _WIN32
 #include <sys/timeb.h>
index 08fa38b..e635574 100644 (file)
@@ -7,6 +7,11 @@
 //teshsuite/simdag/platforms/evaluate_parse_time ../examples/platforms/nancy.xml
 
 #include <stdio.h>
 //teshsuite/simdag/platforms/evaluate_parse_time ../examples/platforms/nancy.xml
 
 #include <stdio.h>
+#include "src/internal_config.h"
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
+
 #include "simgrid/simdag.h"
 #include "surf/surf.h"
 #include "xbt/xbt_os_time.h"
 #include "simgrid/simdag.h"
 #include "surf/surf.h"
 #include "xbt/xbt_os_time.h"