diff configure.ac @ 16313:6aafe87a3144

use int64_t for idx type if --enable-64 * configure.ac: Check for and use int64_t instead of long if --enable-64. (IDX_TYPE_LONG): Delete definion. Change all uses to check USE_64_BIT_IDX_T instead. * MArray-i.cc: Instantiate arrays of int64_t instead of long, but only if USE_64_BIT_IDX_T is defined. * acinclinde.m4 (OCTAVE_CHECK_SIZEOF_FORTRAN_INTEGER): Use int64_t instead of long.
author John W. Eaton <jwe@octave.org>
date Fri, 15 Mar 2013 07:07:08 -0400
parents 00da706fba48
children eb572251b7c6
line wrap: on
line diff
--- a/configure.ac	Fri Mar 15 09:54:53 2013 +0100
+++ b/configure.ac	Fri Mar 15 07:07:08 2013 -0400
@@ -243,17 +243,9 @@
   AC_CHECK_SIZEOF([void *])
   AC_CHECK_SIZEOF([int])
   AC_CHECK_SIZEOF([long])
+  AC_CHECK_SIZEOF([int64_t])
   if test $ac_cv_sizeof_void_p -eq 8; then
-    if test $ac_cv_sizeof_int -eq 8; then
-      OCTAVE_IDX_TYPE=int
-    elif test $ac_cv_sizeof_long -eq 8; then
-      OCTAVE_IDX_TYPE=long
-      AC_DEFINE(IDX_TYPE_LONG, 1, [Define to 1 if octave index type is long.])
-    else
-      warn_64_bit="no suitable type found for octave_idx_type so disabling 64-bit features"
-      OCTAVE_CONFIGURE_WARNING([warn_64_bit])
-      USE_64_BIT_IDX_T=no
-    fi
+    OCTAVE_IDX_TYPE=int64_t
   else
     warn_64_bit="pointers are not 64-bits wide; disabling 64-bit features"
     OCTAVE_CONFIGURE_WARNING([warn_64_bit])
@@ -2749,7 +2741,7 @@
 #endif
 
 #ifdef USE_64_BIT_IDX_T
-#define SIZEOF_OCTAVE_IDX_TYPE 8
+#define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT64_T
 #else
 #define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT
 #endif
@@ -2822,10 +2814,10 @@
 
 /* oct-types.h */
 
+#include <stdint.h>
+
 typedef OCTAVE_IDX_TYPE octave_idx_type;
 
-#include <stdint.h>
-
 /* Tag indicating Octave config.h has been included */
 #define OCTAVE_CONFIG_INCLUDED 1
 ])