diff src/ov.cc @ 8017:260294a5520f

octave_value::idx_type_value: move definition to ov.cc from ov.h
author John W. Eaton <jwe@octave.org>
date Thu, 07 Aug 2008 14:05:11 -0400
parents 3100283874d7
children dc36eb214129
line wrap: on
line diff
--- a/src/ov.cc	Thu Aug 07 01:16:50 2008 -0400
+++ b/src/ov.cc	Thu Aug 07 14:05:11 2008 -0400
@@ -1227,6 +1227,22 @@
   return rep->cell_value ();
 }
 
+// Define the idx_type_value function here instead of in ov.h to avoid
+// needing definitions for the SIZEOF_X macros in ov.h.
+
+octave_idx_type
+octave_value::idx_type_value (bool req_int = false,
+			      bool frc_str_conv = false) const
+{
+#if SIZEOF_OCTAVE_IDX_TYPE == SIZEOF_LONG
+  return long_value (req_int, frc_str_conv);
+#elif SIZEOF_OCTAVE_IDX_TYPE == SIZEOF_INT
+  return int_value (req_int, frc_str_conv);
+#else
+#error "no octave_value extractor for octave_idx_type"
+#endif
+}
+
 Octave_map
 octave_value::map_value (void) const
 {