comparison acinclude.m4 @ 10257:cd550069240e

assume vsnprintf from gnulib; use sstream instead of snprintf
author John W. Eaton <jwe@octave.org>
date Wed, 03 Feb 2010 06:34:29 -0500
parents f751dae7aab8
children 6a50aa2cdf00
comparison
equal deleted inserted replaced
10256:c84186ad78f3 10257:cd550069240e
1358 else 1358 else
1359 AC_MSG_RESULT(no) 1359 AC_MSG_RESULT(no)
1360 [$5] 1360 [$5]
1361 fi 1361 fi
1362 ]) 1362 ])
1363 dnl
1364 dnl Do we have a working c99 vsnprintf function?
1365 dnl
1366 dnl OCTAVE_HAVE_C99_VSNPRINTF
1367 AC_DEFUN([OCTAVE_HAVE_C99_VSNPRINTF], [
1368 AC_CACHE_CHECK([for c99 vsnprintf], [oct_cv_c99_vsnprintf],
1369 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
1370 #include <stdarg.h>
1371 #include <stdlib.h>
1372
1373 int
1374 doit(char * s, ...)
1375 {
1376 char buffer[32];
1377 va_list args;
1378 int r;
1379
1380 va_start(args, s);
1381 r = vsnprintf(buffer, 5, s, args);
1382 va_end(args);
1383
1384 if (r != 7)
1385 exit(1);
1386
1387 exit(0);
1388 }
1389 ]],[
1390 doit("1234567");])],
1391 [oct_cv_c99_vsnprintf=yes],
1392 [oct_cv_c99_vsnprintf=no],
1393 [oct_cv_c99_vsnprintf="guessing no"])])
1394
1395 case $oct_cv_c99_vsnprintf in
1396 yes)
1397 AC_DEFINE([HAVE_C99_VSNPRINTF], [1], [Define if you have a c99 vsnprintf])
1398 ;;
1399 esac
1400 ])
1401 1363
1402 ############################################################################## 1364 ##############################################################################
1403 ############################################################################## 1365 ##############################################################################
1404 1366
1405 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 1367 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-