]> granicus.if.org Git - yasm/commitdiff
Add long long detection to unsigned long long detection.
authorPeter Johnson <peter@tortall.net>
Thu, 13 Feb 2003 06:56:34 +0000 (06:56 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 13 Feb 2003 06:56:34 +0000 (06:56 -0000)
svn path=/trunk/yasm/; revision=832

m4/Makefile.am
m4/longlong.m4 [moved from m4/ulonglong.m4 with 50% similarity]

index 4a9b658ba4c38fb6d5e6e3ef407a2f1c2b2bcac8..e7ea26a03fc7ac068ff9df1004a14d6788bcb2cd 100644 (file)
@@ -13,8 +13,8 @@ EXTRA_DIST = Makefile.am \
        lib-link.m4 \
        lib-prefix.m4 \
        libtool.m4 \
+       longlong.m4 \
        ltdl.m4 \
        progtest.m4 \
        stdint_h.m4 \
-       uintmax_t.m4 \
-       ulonglong.m4
+       uintmax_t.m4
similarity index 50%
rename from m4/ulonglong.m4
rename to m4/longlong.m4
index c375e474c75ef3357a84dcfead448c0a5ead9dc8..daa95c075104b25a915a04af38735d48edffafd4 100644 (file)
@@ -1,13 +1,25 @@
-# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
-dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+#serial 2
 
 dnl From Paul Eggert.
 
+# Define HAVE_LONG_LONG if 'long long' works.
+
+AC_DEFUN([jm_AC_TYPE_LONG_LONG],
+[
+  AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
+  [AC_TRY_LINK([long long ll = 1; int i = 63;],
+    [long long llmax = (long long) -1;
+     return ll << i | ll >> i | llmax / ll | llmax % ll;],
+    ac_cv_type_long_long=yes,
+    ac_cv_type_long_long=no)])
+  if test $ac_cv_type_long_long = yes; then
+    AC_DEFINE(HAVE_LONG_LONG, 1,
+      [Define if you have the long long type.])
+  fi
+])
+
+# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
+
 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
 [
   AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,