Use libc snprintf if available.

SVN revision: 28803
This commit is contained in:
Kim Woelders 2007-03-18 22:29:36 +00:00
parent d83d1aaf7b
commit 57ec0d1a09
3 changed files with 18 additions and 15 deletions

View File

@ -1,14 +1,18 @@
# $Id$
if BUILD_SNPRINTF
SRCS_SNPRINTF = snprintf.c
endif
lib_LTLIBRARIES = libepplet.la
include_HEADERS = epplet.h
libepplet_la_SOURCES = epplet.c snprintf.c
libepplet_la_SOURCES = epplet.c $(SRCS_SNPRINTF)
libepplet_la_DEPENDENCIES = $(top_builddir)/config.h epplet.h
libepplet_la_LDFLAGS = -version-info 1:0:0
libepplet_la_LDFLAGS = -version-info 2:0:0
INCLUDES = -I$(top_srcdir) $(X_CFLAGS) -DEROOT=\"@EROOT@\"
LDADD = -L$(libdir) -L$(prefix)/lib $(LIBS) $(X_LIBS)
EXTRA_DIST = epplet.h.in
EXTRA_DIST = epplet.h.in snprintf.c

View File

@ -41,18 +41,15 @@
#define __sun__
#endif
#if defined(HAVE_VARARGS_H) && !defined(HAVE_STDARG_H)
#include <varargs.h>
int Evsnprintf(char *str, size_t count, const char *fmt, va_list args);
int Esnprintf(va_alist);
#define HAVE_SNPRINTF @HAVE_SNPRINTF@
#if HAVE_SNPRINTF
#define Evsnprintf vsnprintf
#define Esnprintf snprintf
#else
/* If they don't have stdarg.h, they have bigger problems.... */
#include <stdarg.h>
int Evsnprintf(char *str, size_t count, const char *fmt, va_list args);
int Esnprintf(char *str, size_t count, const char *fmt,...);
#endif
int Evsnprintf(char *str, size_t count, const char *fmt,
va_list args);
int Esnprintf(char *str, size_t count, const char *fmt, ...);
#endif /* HAVE_SNPRINTF */
/****************************************************************************/
/* Data structures & primitives */

View File

@ -86,7 +86,9 @@ AC_TYPE_UID_T
dnl# Checks for library functions.
AC_TYPE_SIGNAL
dnl#AC_CHECK_FUNCS()
AC_CHECK_FUNCS(snprintf, x=1, x=0)
AC_SUBST(HAVE_SNPRINTF, $x)
AM_CONDITIONAL(BUILD_SNPRINTF, test "x$x" = "x0")
# ok enlightenment d00ds want to ignore civilization and install
# everything in one place. The rest of use prefer sanity.