Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
stop loading surf.h from C files
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 4 Nov 2017 20:34:44 +0000 (21:34 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 4 Nov 2017 20:49:57 +0000 (21:49 +0100)
src/include/surf/surf.h
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_log_layout_simple.c
teshsuite/simdag/evaluate-parse-time/evaluate-parse-time.c

index 54c1532..9fc3d95 100644 (file)
 #include "simgrid/datatypes.h"
 #include "simgrid/forward.h"
 
+#ifndef __cplusplus
+#error This is a C++ only file, now
+#endif
+
 #ifdef __cplusplus
 
 namespace simgrid {
index ea33369..2be99a6 100644 (file)
@@ -6,8 +6,8 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/host.h"
+#include "simgrid/msg.h" /* MSG_get_clock */
 #include "src/xbt/log_private.h"
-#include "surf/surf.h"
 #include "xbt/sysdep.h"
 #include <stdio.h>
 
@@ -145,10 +145,10 @@ static int xbt_log_layout_format_doit(xbt_log_layout_t l, xbt_log_event_t ev, co
             show_string(ev->functionName);
             break;
           case 'd': /* date; LOG4J compliant */
-            show_double(surf_get_clock());
+            show_double(MSG_get_clock());
             break;
           case 'r': /* application age; LOG4J compliant */
-            show_double(surf_get_clock() - format_begin_of_time);
+            show_double(MSG_get_clock() - format_begin_of_time);
             break;
           case 'm': { /* user-provided message; LOG4J compliant */
             int sz;
@@ -189,7 +189,7 @@ xbt_log_layout_t xbt_log_layout_format_new(char *arg)
   res->data = xbt_strdup((char *) arg);
 
   if (format_begin_of_time < 0)
-    format_begin_of_time = surf_get_clock();
+    format_begin_of_time = MSG_get_clock();
 
   return res;
 }
index 65040fa..2716d98 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/xbt/log_private.h"
 
 #include "simgrid/host.h" /* sg_host_self_get_name */
-#include "surf/surf.h"
+#include "simgrid/msg.h"  /* MSG_get_clock */
 #include <stdio.h>
 
 extern const char *xbt_log_priority_names[8];
@@ -45,7 +45,7 @@ static int xbt_log_layout_simple_doit(XBT_ATTRIB_UNUSED xbt_log_layout_t l, xbt_
   }
 
   /* Display the date */
-  len = snprintf(p, rem_size, "%f] ", surf_get_clock() - simple_begin_of_time);
+  len = snprintf(p, rem_size, "%f] ", MSG_get_clock() - simple_begin_of_time);
   check_overflow(len);
 
   /* Display file position if not INFO */
@@ -76,7 +76,7 @@ xbt_log_layout_t xbt_log_layout_simple_new(XBT_ATTRIB_UNUSED char* arg)
   res->do_layout       = &xbt_log_layout_simple_doit;
 
   if (simple_begin_of_time < 0)
-    simple_begin_of_time = surf_get_clock();
+    simple_begin_of_time = MSG_get_clock();
 
   return res;
 }
index 9bce26c..d2dde0e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2008-2017. 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. */
@@ -13,7 +12,6 @@
 #endif
 
 #include "simgrid/simdag.h"
-#include "surf/surf.h"
 #include "xbt/xbt_os_time.h"
 
 int main(int argc, char **argv)