SimGrid (3.10) NOT RELEASED; urgency=low
XBT:
- * Our own implementation of getline is renamed xbt_getline.
+ * Our own implementation of getline is renamed xbt_getline, and gets
+ used even if the OS provide a getline(). This should reduce the
+ configuration complexity by using the same code on all platforms.
Java:
* Reintegrate Java to the main archive as desynchronizing these
endforeach(fct ${diff_va})
#--------------------------------------------------------------------------------------------------
-### check for getline
-try_compile(COMPILE_RESULT_VAR
- ${CMAKE_BINARY_DIR}
- ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_getline.c
- )
-
-if(NOT COMPILE_RESULT_VAR)
- SET(need_getline "#define SIMGRID_NEED_GETLINE 1")
- SET(SIMGRID_NEED_GETLINE 1)
-else()
- SET(need_getline "")
- SET(SIMGRID_NEED_GETLINE 0)
-endif()
-
### check for a working snprintf
if(HAVE_SNPRINTF AND HAVE_VSNPRINTF OR WIN32)
if(WIN32)
buildtools/Cmake/src/internal_config.h.in
buildtools/Cmake/src/simgrid.nsi.in
buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c
- buildtools/Cmake/test_prog/prog_getline.c
buildtools/Cmake/test_prog/prog_gnu_dynlinker.c
buildtools/Cmake/test_prog/prog_gtnets.cpp
buildtools/Cmake/test_prog/prog_mutex_timedlock.c
message("")
message("SIZEOF_MAX ..................: ${SIZEOF_MAX}")
message("PTH_STACKGROWTH .............: ${PTH_STACKGROWTH}")
- message("need_getline ................: ${need_getline}")
message("need_asprintf ...............: ${simgrid_need_asprintf}")
message("need_vasprintf ..............: ${simgrid_need_vasprintf}")
message("PREFER_PORTABLE_SNPRINTF ....: ${PREFER_PORTABLE_SNPRINTF}")
/* define for stack growth */
#cmakedefine PTH_STACKGROWTH @PTH_STACKGROWTH@
-/* enable the getline replacement */
-#cmakedefine SIMGRID_NEED_GETLINE @SIMGRID_NEED_GETLINE@
-
/* The maximal size of any scalar on this arch */
#cmakedefine SIZEOF_MAX @SIZEOF_MAX@
+++ /dev/null
-/* Copyright (c) 2010. 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. */
-
-#define _GNU_SOURCE
-#include <stdio.h>
-int main(void)
-{
- FILE *fp;
- char *line = NULL;
- size_t len = 0;
- getline(&line, &len, fp);
-}
#include "Summa.h"
#include "2.5D_MM.h"
#include <stdlib.h>
+#include <stdio.h>
#include "xbt/log.h"
#define CHECK_25D 1
#include "Matrix_init.h"
#include "Summa.h"
#include "xbt/log.h"
+#include <stdio.h>
+
XBT_LOG_NEW_DEFAULT_CATEGORY(MM_Summa,
"Messages specific for this msg example");
#cmakedefine HAVE_MMAP @HAVE_MMAP@
/* Get the config */
-#undef SIMGRID_NEED_GETLINE
#undef SIMGRID_NEED_ASPRINTF
#undef SIMGRID_NEED_VASPRINTF
-@need_getline@
@simgrid_need_asprintf@
@simgrid_need_vasprintf@
-#include <stdio.h> /* FILE, getline if it exists */
-#include <stdlib.h> /* size_t, ssize_t */
-XBT_PUBLIC(ssize_t) xbt_getline(char **lineptr, size_t * n, FILE * stream);
-
#include <stdarg.h>
/* snprintf related functions */
* @brief String manipulation functions
*
* This module defines several string related functions. We redefine some quite classical
- * functions on the platforms were they are not nativaly defined (such as getline() or
+ * functions on the platforms were they are not nativaly defined (such as xbt_getline() or
* asprintf()), while some other are a bit more exotic.
* @{
*/
+/* Our own implementation of getline, mainly useful on the platforms not enjoying this function */
+#include <stdio.h> /* FILE */
+#include <stdlib.h> /* size_t, ssize_t */
+XBT_PUBLIC(ssize_t) xbt_getline(char **lineptr, size_t * n, FILE * stream);
+
/* Trim related functions */
XBT_PUBLIC(void) xbt_str_rtrim(char *s, const char *char_list);
XBT_PUBLIC(void) xbt_str_ltrim(char *s, const char *char_list);
/* automaton - representation of büchi automaton */
-/* Copyright (c) 2011. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2011-2013. 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. */
#include "xbt/automaton.h"
+#include <stdio.h> /* printf */
xbt_automaton_t xbt_automaton_new(){
xbt_automaton_t automaton = NULL;
/** @brief Get a single line from the stream (reimplementation of the GNU getline)
*
- * This is a redefinition of the GNU getline function, used on platforms where
- * it does not exists.
+ * This is a reimplementation of the GNU getline function, so that our code don't depends on the GNU libc.
*
* xbt_getline() reads an entire line from stream, storing the address of the
* buffer containing the text into *buf. The buffer is null-terminated and
*/
ssize_t xbt_getline(char **buf, size_t * n, FILE * stream)
{
-#if !defined(SIMGRID_NEED_GETLINE)
- return getline(buf, n, stream);
-#else
size_t i;
int ch;
(*buf)[i] = '\0';
return (ssize_t) i;
-#endif
}
/*