From: Martin Quinson Date: Sat, 4 Nov 2017 20:34:44 +0000 (+0100) Subject: stop loading surf.h from C files X-Git-Tag: v3.18~291 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/73cbfdeeced9e5b254ed410c5dfaf8e3195d35e8?ds=inline stop loading surf.h from C files --- diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 54c15326d6..9fc3d95b67 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -17,6 +17,10 @@ #include "simgrid/datatypes.h" #include "simgrid/forward.h" +#ifndef __cplusplus +#error This is a C++ only file, now +#endif + #ifdef __cplusplus namespace simgrid { diff --git a/src/xbt/xbt_log_layout_format.c b/src/xbt/xbt_log_layout_format.c index ea33369b7a..2be99a6558 100644 --- a/src/xbt/xbt_log_layout_format.c +++ b/src/xbt/xbt_log_layout_format.c @@ -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 @@ -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; } diff --git a/src/xbt/xbt_log_layout_simple.c b/src/xbt/xbt_log_layout_simple.c index 65040fa8f4..2716d987a7 100644 --- a/src/xbt/xbt_log_layout_simple.c +++ b/src/xbt/xbt_log_layout_simple.c @@ -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 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; } diff --git a/teshsuite/simdag/evaluate-parse-time/evaluate-parse-time.c b/teshsuite/simdag/evaluate-parse-time/evaluate-parse-time.c index 9bce26c5e3..d2dde0e882 100644 --- a/teshsuite/simdag/evaluate-parse-time/evaluate-parse-time.c +++ b/teshsuite/simdag/evaluate-parse-time/evaluate-parse-time.c @@ -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)