1
1

Probably an unpopular change, but...

In order to get consistent behaviour on linux with various gcc versions,
I am defining _GNU_SOURCE in ompi_config.h and changing the definition
of asprintf, etc.

Problems:
1) autoconf was defining _GNU_SOURCE for its tests, but we were not
setting it
2) g++ sets it by default (I think)
3) some version of gcc set it by default

If somebody knows a consistent solution for these problems then we can
revert to not setting it.

This commit was SVN r2230.
Этот коммит содержится в:
David Daniel 2004-08-19 19:27:15 +00:00
родитель 8fd9c65362
Коммит 5ce8144d91
2 изменённых файлов: 38 добавлений и 4 удалений

Просмотреть файл

@ -42,6 +42,12 @@ ompi_show_subtitle "Initialization, setup"
AM_INIT_AUTOMAKE(openmpi, $OMPI_VERSION, 'no')
#
# GNU C and autotools are inconsistent about whether this is defined
# so let's make it true everywhere for now...
#
AC_GNU_SOURCE
OMPI_TOP_BUILDDIR="`pwd`"
AC_SUBST(OMPI_TOP_BUILDDIR)
cd "$srcdir"

Просмотреть файл

@ -108,19 +108,47 @@ typedef struct {
/*
* printf functions for portability
*/
#if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF)
#if __STDC__
#include <stdarg.h>
#else
#ifdef __cplusplus
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#endif /* __STDC__ */
#endif
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
#include <stdlib.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef HAVE_ASPRINTF
# include "util/printf.h"
int ompi_asprintf(char **, const char *, ...);
# define asprintf ompi_asprintf
#endif
#ifndef HAVE_SNPRINTF
# include "util/printf.h"
int ompi_snprintf(char *, size_t, const char *, ...);
# define snprintf ompi_snprintf
#endif
#ifndef HAVE_VASPRINTF
# include "util/printf.h"
int ompi_vasprintf(char **, const char *, va_list);
# define vasprintf ompi_vasprintf
#endif
#ifndef HAVE_VSNPRINTF
# include "util/printf.h"
int ompi_vsnprintf(char *, size_t, const char *, va_list);
# define vsnprintf ompi_vsnprintf
#endif
#ifdef __cplusplus
}
#endif