From: Ben Pfaff <blp@gnu.org>
Date: Sat, 13 Oct 2007 04:57:48 +0000 (+0000)
Subject: Use trunc module from gnulib instead of our home-grown solution.
X-Git-Tag: v0.6.0~218
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49622888cd4954bf11544b2e43f58e523c9954b5;p=pspp-builds.git

Use trunc module from gnulib instead of our home-grown solution.
Patch #6224.

* helpers.c: Don't need our own trunc function implementation
anymore, since we now use the one from gnulib.

* Smake: Add trunc to module list.

* configure.ac: Don't need to check for trunc function any longer.
---

diff --git a/ChangeLog b/ChangeLog
index 50a29eef..853b0724 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-10-12  Ben Pfaff  <blp@gnu.org>
+
+	Use trunc module from gnulib instead of our home-grown solution.
+	Patch #6224.
+
+	* Smake: Add trunc to module list.
+
+	* configure.ac: Don't need to check for trunc function any longer.
+
 2007-10-12  Ben Pfaff  <blp@gnu.org>
 
 	Use fseeko module from gnulib instead of our home-grown solution.
diff --git a/Smake b/Smake
index 21e6a224..d2dc497a 100644
--- a/Smake
+++ b/Smake
@@ -60,6 +60,7 @@ GNULIB_MODULES = \
 	strtoul \
 	sys_stat \
 	tmpfile \
+	trunc \
 	unistd \
 	unlocked-io \
 	vasprintf-posix \
diff --git a/configure.ac b/configure.ac
index d16c6f49..f738c50b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,7 +77,7 @@ AC_CHECK_SIZEOF(long double)
 
 AC_C_BIGENDIAN
 
-AC_CHECK_FUNCS([__setfpucw fork execl execlp isinf isnan finite getpid feholdexcept fpsetmask popen round trunc])
+AC_CHECK_FUNCS([__setfpucw fork execl execlp isinf isnan finite getpid feholdexcept fpsetmask popen round])
 
 AC_PROG_LN_S
 
diff --git a/src/language/expressions/ChangeLog b/src/language/expressions/ChangeLog
index a5895b66..a59accb6 100644
--- a/src/language/expressions/ChangeLog
+++ b/src/language/expressions/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-12  Ben Pfaff  <blp@gnu.org>
+
+	Patch #6224.
+
+	* helpers.c: Don't need our own trunc function implementation
+	anymore, since we now use the one from gnulib.
+
 2007-07-17  Ben Pfaff  <blp@gnu.org>
 
 	Patch #19335.  Reviewed by John Darrington.
diff --git a/src/language/expressions/helpers.c b/src/language/expressions/helpers.c
index a0f0c0fc..a28f1a66 100644
--- a/src/language/expressions/helpers.c
+++ b/src/language/expressions/helpers.c
@@ -131,15 +131,6 @@ enum date_unit
     DATE_SECONDS
   };
 
-#ifndef HAVE_TRUNC
-/* Return X rounded toward zero. */
-static double
-trunc (double x)
-{
-  return x >= 0.0 ? floor (x) : ceil (x);
-}
-#endif /* !HAVE_TRUNC */
-
 /* Stores in *UNIT the unit whose name is NAME.
    Return success. */
 static enum date_unit