summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac2
-rw-r--r--src/arith_yacc.c9
3 files changed, 5 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index b96e5b2..02bfda0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-26  Harald van Dijk <harald@gigawatt.nl>
+
+	* Avoid imaxdiv when only one of the results is wanted.
+
 2010-07-09  maximilian attems <max@stro.at>
 
 	* Fix klibc DEBUG compilation.
diff --git a/configure.ac b/configure.ac
index 7eae954..5cd6e95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,7 @@ AC_CHECK_DECL([PRIdMAX],,
 ])
 
 dnl Checks for library functions.
-AC_CHECK_FUNCS(bsearch faccessat getpwnam getrlimit imaxdiv isalpha killpg \
+AC_CHECK_FUNCS(bsearch faccessat getpwnam getrlimit isalpha killpg \
 	       mempcpy \
 	       sigsetmask stpcpy strchrnul strsignal strtod strtoimax \
 	       strtoumax sysconf)
diff --git a/src/arith_yacc.c b/src/arith_yacc.c
index bf21830..1a087c3 100644
--- a/src/arith_yacc.c
+++ b/src/arith_yacc.c
@@ -94,22 +94,13 @@ static inline int higher_prec(int op1, int op2)
 
 static intmax_t do_binop(int op, intmax_t a, intmax_t b)
 {
-#ifdef HAVE_IMAXDIV
-	imaxdiv_t div;
-#endif
-
 	switch (op) {
 	default:
 	case ARITH_REM:
 	case ARITH_DIV:
 		if (!b)
 			yyerror("division by zero");
-#ifdef HAVE_IMAXDIV
-		div = imaxdiv(a, b);
-		return op == ARITH_REM ? div.rem : div.quot;
-#else
 		return op == ARITH_REM ? a % b : a / b;
-#endif
 	case ARITH_MUL:
 		return a * b;
 	case ARITH_ADD: