Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Once again, Linux does not follow the real way of doing things.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 10 Oct 2013 12:39:30 +0000 (14:39 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 10 Oct 2013 12:52:12 +0000 (14:52 +0200)
The default buffering mode for output streams seems different on
Windows (lines don't mix in the same order between stdout and stderr).
Use unbuffered mode, since line buffer mode is not supported on these
systems.

See http://msdn.microsoft.com/en-us/library/86cebhfs%28v=vs.71%29.aspx
   _IOLBF
     For some systems, this provides line buffering. However, for Win32,
     the behavior is the same as _IOFBF - Full Buffering."

Let's wait for the cdash to confirm that it works...

teshsuite/simdag/platforms/basic_parsing_test.c
teshsuite/simdag/platforms/flatifier.c

index 660d1fb..aaffd2e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2012. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -23,7 +23,12 @@ int main(int argc, char **argv)
   int route_size, i, j, k;
   int list_size;
 
+#ifdef _XBT_WIN32
+  setbuf(stderr, NULL);
+  setbuf(stdout, NULL);
+#else
   setvbuf(stdout, NULL, _IOLBF, 0);
+#endif
 
   SD_init(&argc, argv);
 
index f523ce6..46ae1b4 100644 (file)
@@ -104,7 +104,12 @@ int main(int argc, char **argv)
   const SD_link_t *links;
   xbt_os_timer_t parse_time = xbt_os_timer_new();
 
+#ifdef _XBT_WIN32
+  setbuf(stderr, NULL);
+  setbuf(stdout, NULL);
+#else
   setvbuf(stdout, NULL, _IOLBF, 0);
+#endif
 
   SD_init(&argc, argv);