Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill the portable header
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 9 Mar 2016 20:52:55 +0000 (21:52 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 9 Mar 2016 21:32:32 +0000 (22:32 +0100)
such centralized header is not a good idea, as it tend to the
inflation of header inclusions. I prefer having each file specifying
precisely which header they need.

19 files changed:
src/include/surf/maxmin.h
src/include/surf/surf.h
src/portable.h [deleted file]
src/simix/ThreadContext.cpp
src/simix/smx_context.cpp
src/simix/smx_global.cpp
src/surf/surf_interface.cpp
src/xbt/cunit.c
src/xbt/dict.c
src/xbt/ex.c
src/xbt/log.c
src/xbt/mmalloc/mmprivate.h
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_log_layout_simple.c
src/xbt/xbt_main.c
src/xbt/xbt_os_file.c
src/xbt/xbt_os_thread.c
src/xbt/xbt_str.c
tools/cmake/DefinePackages.cmake

index 2e0f5ad..1c7e1e8 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef _SURF_MAXMIN_H
 #define _SURF_MAXMIN_H
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/misc.h"
 #include "xbt/asserts.h"
 #include "surf/datatypes.h"
index 5a78792..405f4e0 100644 (file)
@@ -13,7 +13,7 @@
 #include "xbt/graph.h"
 #include "xbt/misc.h"
 #include "xbt/config.h"
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "surf/surf_routing.h"
 #include "surf/datatypes.h"
 #include "xbt/lib.h"
diff --git a/src/portable.h b/src/portable.h
deleted file mode 100644 (file)
index c9a77e3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* portable -- header loading to write portable code within SimGrid         */
-
-/* Copyright (c) 2004, 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. */
-
-#ifndef SIMGRID_PORTABLE_H
-#define SIMGRID_PORTABLE_H
-
-#include "src/internal_config.h"  /* some information about the environment */
-
-#ifdef _WIN32
-# include <windows.h>
-#endif
-
-#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_SYSCTL_H
-# include <sys/sysctl.h>
-#endif
-
-/* File handling */
-#ifdef _WIN32
-  #ifndef S_IRGRP
-    #define S_IRGRP 0
-  #endif
-#endif
-#endif                          /* SIMGRID_PORTABLE_H */
index c84dc52..91857d8 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "xbt/function_types.h"
 #include "smx_private.h"
-#include "src/portable.h"           /* loads context system definitions */
+#include "src/internal_config.h"           /* loads context system definitions */
 #include "xbt/swag.h"
 #include "xbt/xbt_os_thread.h"
 #include "src/xbt_modinter.h"       /* prototype of os thread module's init/exit in XBT */
index b1bc093..87ea4dc 100644 (file)
@@ -6,7 +6,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 "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/log.h"
 #include "xbt/swag.h"
 #include "xbt/xbt_os_thread.h"
index 2ef29f3..b48faf5 100644 (file)
@@ -5,7 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <stdlib.h>
-#include "src/portable.h"
+#include "src/internal_config.h"
 
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/storage_interface.hpp"
index 8226352..1dcc754 100644 (file)
@@ -4,7 +4,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 "src/portable.h"
+#include "src/internal_config.h"
 #include "surf_private.h"
 #include "surf_interface.hpp"
 #include "network_interface.hpp"
index 550eb9e..01c3f3e 100644 (file)
@@ -9,7 +9,7 @@
 /* This is partially inspirated from the OSSP ts (Test Suite Library)       */
 /* At some point we should use https://github.com/google/googletest instead */
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include <stdio.h>
 
 #include "xbt/sysdep.h"         /* bvprintf */
index c2268fa..28c1165 100644 (file)
@@ -603,7 +603,7 @@ void xbt_dict_postexit(void)
 #ifdef SIMGRID_TEST
 #include "xbt.h"
 #include "xbt/ex.h"
-#include "src/portable.h"
+#include "src/internal_config.h"
 
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_dict);
index f5050cc..9d3dca6 100644 (file)
@@ -45,7 +45,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "src/portable.h"           /* execinfo when available */
+#include "src/internal_config.h"           /* execinfo when available */
 #include "xbt/ex.h"
 #include "xbt/str.h"
 #include "xbt/synchro_core.h"
index 1a13c86..8701f99 100644 (file)
@@ -11,7 +11,7 @@
 #include <stdio.h>              /* snprintf */
 #include <stdlib.h>             /* snprintf */
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 
 #include "src/xbt_modinter.h"
 
index 2528b8f..ec15500 100644 (file)
@@ -17,7 +17,7 @@
 #include <xbt/base.h>
 #include <xbt/misc.h>
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/xbt_os_thread.h"
 #include "xbt/mmalloc.h"
 #include "xbt/ex.h"
index b93ecad..a541362 100644 (file)
@@ -6,7 +6,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 "src/portable.h"       /* execinfo when available */
+#include "src/internal_config.h"       /* execinfo when available */
 #include "xbt/synchro_core.h"   /* xbt_thread_self_name */
 #include "src/xbt/ex_interface.h"
 #include "xbt/sysdep.h"
index 8f25418..5ef77ba 100644 (file)
@@ -13,7 +13,7 @@
 #include "simgrid/simix.h"      /* SIMIX_host_self_get_name */
 #include "surf/surf.h"
 #include <stdio.h>
-#include "src/portable.h"
+#include "src/internal_config.h"
 
 extern const char *xbt_log_priority_names[8];
 extern int xbt_log_no_loc;
index ec1bddf..61551df 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "simgrid/sg_config.h"
 
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include <stdio.h>
 #ifdef _WIN32
 #include <signal.h> /* To silence MSVC on abort() */
index be781e1..4cc64d2 100644 (file)
@@ -9,7 +9,11 @@
 #include "xbt/sysdep.h"
 #include "xbt/file.h"    /* this module */
 #include "xbt/log.h"
-#include "src/portable.h"
+#include "src/internal_config.h"
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
 
 #ifndef _MSC_VER
 #include "libgen.h" /* POSIX dirname */
index d5d9739..b80fb31 100644 (file)
@@ -25,7 +25,8 @@
 #include <semaphore.h>
 #include <errno.h>
 
-#if defined(WIN32)
+#if defined(_WIN32)
+#include <windows.h>
 #elif defined(__MACH__) && defined(__APPLE__)
 #include <stdint.h>
 #include <sys/types.h>
@@ -37,7 +38,7 @@
 #include "xbt/sysdep.h"
 #include "xbt/ex.h"
 #include "src/xbt/ex_interface.h"  /* We play crude games with exceptions */
-#include "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/xbt_os_time.h"       /* Portable time facilities */
 #include "xbt/xbt_os_thread.h"     /* This module */
 #include "src/xbt_modinter.h"      /* Initialization/finalization of this module */
index 14f928f..5c1e852 100644 (file)
@@ -6,7 +6,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 "src/portable.h"
+#include "src/internal_config.h"
 #include "xbt/misc.h"
 #include "xbt/sysdep.h"
 #include "xbt/str.h"            /* headers of these functions */
index 7aac810..053598d 100644 (file)
@@ -14,7 +14,6 @@ set(EXTRA_DIST
   src/include/surf/maxmin.h
   src/include/surf/surf.h
   src/msg/msg_private.h
-  src/portable.h
   src/simdag/dax.dtd
   src/simdag/dax_dtd.c
   src/simdag/dax_dtd.h