diff liboctave/array/MArray-i.cc @ 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 648dabbb4c6b
children d63878346099
line wrap: on
line diff
--- a/liboctave/array/MArray-i.cc
+++ b/liboctave/array/MArray-i.cc
@@ -32,7 +32,9 @@
 #include "MArray.cc"
 
 template class OCTAVE_API MArray<int>;
-template class OCTAVE_API MArray<long>;
+#ifdef USE_64_BIT_IDX_T
+template class OCTAVE_API MArray<int64_t>;
+#endif
 
 // Explicit instantiation, as this seems to be required by weird compilers
 // like MSVC. This should be harmless on other compilers.
@@ -42,7 +44,9 @@
 template long xmax<long> (long, long);
 
 INSTANTIATE_MARRAY_FRIENDS (int, OCTAVE_API)
-INSTANTIATE_MARRAY_FRIENDS (long, OCTAVE_API)
+#ifdef USE_64_BIT_IDX_T
+INSTANTIATE_MARRAY_FRIENDS (int64_t, OCTAVE_API)
+#endif
 
 template class OCTAVE_API MArray<octave_int8>;
 template class OCTAVE_API MArray<octave_int16>;