Detect missing lround function.
This commit is contained in:
parent
36039e13ec
commit
fd94268315
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: config.h.in,v 1.21 2006/04/25 22:41:10 steve Exp $"
|
||||
#ident "$Id: config.h.in,v 1.22 2006/04/27 05:04:59 steve Exp $"
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
|
@ -49,6 +49,7 @@
|
|||
# undef HAVE_READLINE_READLINE_H
|
||||
# undef HAVE_READLINE_HISTORY_H
|
||||
# undef HAVE_STDINT_H
|
||||
# undef HAVE_LROUND
|
||||
|
||||
/* Figure if I can use readline. */
|
||||
#undef USE_READLINE
|
||||
|
|
@ -89,6 +90,14 @@ typedef unsigned long vvp_time64_t;
|
|||
# undef HAVE_SYS_RESOURCE_H
|
||||
# undef LINUX
|
||||
|
||||
#if !defined(HAVE_LROUND)
|
||||
#if defined(__cplusplus)
|
||||
extern "C" long lround(double x);
|
||||
#else
|
||||
extern long lround(double x);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* When doing dynamic linking, we need a uniform way to identify the
|
||||
|
|
@ -110,6 +119,9 @@ typedef unsigned long vvp_time64_t;
|
|||
|
||||
/*
|
||||
* $Log: config.h.in,v $
|
||||
* Revision 1.22 2006/04/27 05:04:59 steve
|
||||
* Detect missing lround function.
|
||||
*
|
||||
* Revision 1.21 2006/04/25 22:41:10 steve
|
||||
* Detect the presence of stdint.h
|
||||
*
|
||||
|
|
|
|||
|
|
@ -73,6 +73,10 @@ case "${host}" in
|
|||
;;
|
||||
esac
|
||||
|
||||
# Check that these functions exist. They are mostly C99
|
||||
# functions that older compilers may not yet support.
|
||||
AC_CHECK_FUNCS(lround)
|
||||
|
||||
# see how we can give some resource usage stats with -v
|
||||
# Linux does not provide mem stats in rusage, use /proc/self/statm.
|
||||
|
||||
|
|
|
|||
20
vvp/main.cc
20
vvp/main.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: main.cc,v 1.40 2005/01/29 06:28:19 steve Exp $"
|
||||
#ident "$Id: main.cc,v 1.41 2006/04/27 05:04:59 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -53,6 +53,21 @@ extern "C" int optind;
|
|||
extern "C" const char*optarg;
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_LROUND)
|
||||
/*
|
||||
* If the system doesn't provide the lround function, then we provide
|
||||
* it ourselves here. It is simply the nearest integer, rounded away
|
||||
* from zero.
|
||||
*/
|
||||
extern "C" long int lround(float x)
|
||||
{
|
||||
if (x >= 0.0)
|
||||
return floor(x+0.5);
|
||||
else
|
||||
return ceil(x-0.5);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool verbose_flag = false;
|
||||
|
||||
static char log_buffer[4096];
|
||||
|
|
@ -281,6 +296,9 @@ int main(int argc, char*argv[])
|
|||
|
||||
/*
|
||||
* $Log: main.cc,v $
|
||||
* Revision 1.41 2006/04/27 05:04:59 steve
|
||||
* Detect missing lround function.
|
||||
*
|
||||
* Revision 1.40 2005/01/29 06:28:19 steve
|
||||
* Add the -s flag to start up interactive.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue