Clean up dead code in recent commit. 20100521040508/gnulib 20100521090628/gnulib 20100522040502/gnulib 20100523040502/gnulib 20100524040503/gnulib 20100525040507/gnulib 20100526040502/gnulib 20100527040507/gnulib 20100528040502/gnulib 20100529040502/gnulib 20100530040501/gnulib 20100531040501/gnulib 20100601040502/gnulib 20100602040502/gnulib 20100603040507/gnulib 20100605040507/gnulib 20100606040502/gnulib 20100607040503/gnulib 20100608040508/gnulib 20100609040502/gnulib
authorBruno Haible <bruno@clisp.org>
Wed, 19 May 2010 21:30:18 +0000 (23:30 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 19 May 2010 21:30:18 +0000 (23:30 +0200)
ChangeLog
m4/libunistring-base.m4

index 5bc2c09a5a0605d24652517650524d04d90621dd..8fcce2671e092c9294fd303e2d7d8fa8f420801f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-19  Bruno Haible  <bruno@clisp.org>
+
+       Clean up dead code in recent commit.
+       * m4/libunistring-base.m4 (gl_LIBUNISTRING_VERSION_CMP): Include the
+       body of gl_LIBUNISTRING_VERSION_CMP_ORIG as fallback.
+       (gl_LIBUNISTRING_VERSION_CMP_ORIG): Remove macro.
+       Suggested by Paolo Bonzini.
+
 2010-05-19  Bruno Haible  <bruno@clisp.org>
 
        Avoid valgrind error reports from libunistring.
index 355fe2f30edb650c01f60d61f7fc32a567d2fe77..54aa521c7a792a436c98eac8b974ab1e2532dfd3 100644 (file)
@@ -1,4 +1,4 @@
-# libunistring-base.m4 serial 1
+# libunistring-base.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -97,45 +97,43 @@ changequote([,])
 dnl gl_LIBUNISTRING_VERSION_CMP([VERSION])
 dnl Expands to a shell statement that evaluates to true if LIBUNISTRING_VERSION
 dnl is less than the VERSION argument.
-dnl This is the unoptimized variant:
-AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP_ORIG],
-[ { test "$HAVE_LIBUNISTRING" != yes \
-    || {
-         requested_version_major=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_major"`
-         requested_version_minor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_minor"`
-         requested_version_subminor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_subminor"`
-         test $LIBUNISTRING_VERSION_MAJOR -lt $requested_version_major \
-         || { test $LIBUNISTRING_VERSION_MAJOR -eq $requested_version_major \
-              && { test $LIBUNISTRING_VERSION_MINOR -lt $requested_version_minor \
-                   || { test $LIBUNISTRING_VERSION_MINOR -eq $requested_version_minor \
-                        && test $LIBUNISTRING_VERSION_SUBMINOR -lt $requested_version_subminor
-                      }
-                 }
-            }
-       }
-  }
-])
-dnl This is the optimized variant, that assumes the argument is a literal:
 AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP],
 [ { test "$HAVE_LIBUNISTRING" != yes \
     || {
-         m4_pushdef([requested_version_major],
-           [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^\([0-9]*\).*], [\1]), [])])
-         m4_pushdef([requested_version_minor],
-           [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.]\([0-9]*\).*], [\1]), [$1])])
-         m4_pushdef([requested_version_subminor],
-           [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.][0-9]*[.]\([0-9]*\).*], [\1]), [$1])])
-         test $LIBUNISTRING_VERSION_MAJOR -lt requested_version_major \
-         || { test $LIBUNISTRING_VERSION_MAJOR -eq requested_version_major \
-              && { test $LIBUNISTRING_VERSION_MINOR -lt requested_version_minor \
-                   || { test $LIBUNISTRING_VERSION_MINOR -eq requested_version_minor \
-                        && test $LIBUNISTRING_VERSION_SUBMINOR -lt requested_version_subminor
-                      }
-                 }
-            }
-         m4_popdef([requested_version_subminor])
-         m4_popdef([requested_version_minor])
-         m4_popdef([requested_version_major])
+         dnl AS_LITERAL_IF exists and works fine since autoconf-2.59 at least.
+         AS_LITERAL_IF([$1],
+           [dnl This is the optimized variant, that assumes the argument is a literal:
+            m4_pushdef([requested_version_major],
+              [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^\([0-9]*\).*], [\1]), [])])
+            m4_pushdef([requested_version_minor],
+              [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.]\([0-9]*\).*], [\1]), [$1])])
+            m4_pushdef([requested_version_subminor],
+              [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.][0-9]*[.]\([0-9]*\).*], [\1]), [$1])])
+            test $LIBUNISTRING_VERSION_MAJOR -lt requested_version_major \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq requested_version_major \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt requested_version_minor \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq requested_version_minor \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt requested_version_subminor
+                         }
+                    }
+               }
+            m4_popdef([requested_version_subminor])
+            m4_popdef([requested_version_minor])
+            m4_popdef([requested_version_major])
+           ],
+           [dnl This is the unoptimized variant:
+            requested_version_major=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_major"`
+            requested_version_minor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_minor"`
+            requested_version_subminor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_subminor"`
+            test $LIBUNISTRING_VERSION_MAJOR -lt $requested_version_major \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq $requested_version_major \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt $requested_version_minor \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq $requested_version_minor \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt $requested_version_subminor
+                         }
+                    }
+               }
+           ])
        }
   }
 ])