changeset 29246:1b2845593788

Export Array template specializations (patch #8919). * liboctave/array/Array.cc (NO_INSTANTIATE_ARRAY_SORT, INSTANTIATE_ARRAY): Add API tag to template specializations. * libinterp/template-inst/Array-jit.cc, libinterp/template-inst/Array-tc.cc, liboctave/array/Array-b.cc, liboctave/array/Array-C.cc, liboctave/array/Array-ch.cc, liboctave/array/Array-d.cc, liboctave/array/Array-f.cc, liboctave/array/Array-fC.cc, liboctave/array/Array-i.cc, liboctave/array/Array-idx-vec.cc, liboctave/array/Array-str.cc, liboctave/array/Array-voidp.cc: Pass API tags to function macros instantiating Array template class.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 02 Jan 2021 15:46:16 +0100
parents 33496684ca5d
children d83ae0145030
files libinterp/template-inst/Array-jit.cc libinterp/template-inst/Array-tc.cc liboctave/array/Array-C.cc liboctave/array/Array-b.cc liboctave/array/Array-ch.cc liboctave/array/Array-d.cc liboctave/array/Array-f.cc liboctave/array/Array-fC.cc liboctave/array/Array-i.cc liboctave/array/Array-idx-vec.cc liboctave/array/Array-s.cc liboctave/array/Array-str.cc liboctave/array/Array-voidp.cc liboctave/array/Array.cc
diffstat 14 files changed, 46 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/template-inst/Array-jit.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/libinterp/template-inst/Array-jit.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -40,12 +40,12 @@
 extern template class Array<idx_vector>;
 extern template class Array<octave_idx_type>;
 
-NO_INSTANTIATE_ARRAY_SORT (octave::jit_function);
+NO_INSTANTIATE_ARRAY_SORT (octave::jit_function, OCTINTERP_API);
 
 // Visibility attributes are ignored on template instantiation.
 // As a work-around, set visibility to default overriding compiler options.
 #pragma GCC visibility push(default)
-INSTANTIATE_ARRAY (octave::jit_function);
+INSTANTIATE_ARRAY (octave::jit_function, OCTINTERP_API);
 #pragma GCC visibility pop
 
 #if defined (Cell_h)
--- a/libinterp/template-inst/Array-tc.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/libinterp/template-inst/Array-tc.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -54,13 +54,13 @@
 // Visibility attributes are ignored on template instantiation.
 // As a work-around, set visibility to default overriding compiler options.
 #pragma GCC visibility push(default)
-NO_INSTANTIATE_ARRAY_SORT (octave_value);
-INSTANTIATE_ARRAY (octave_value);
+NO_INSTANTIATE_ARRAY_SORT (octave_value, OCTINTERP_API);
+INSTANTIATE_ARRAY (octave_value, OCTINTERP_API);
 
-NO_INSTANTIATE_ARRAY_SORT (octave_value *);
-INSTANTIATE_ARRAY (octave_value *);
+NO_INSTANTIATE_ARRAY_SORT (octave_value *, OCTINTERP_API);
+INSTANTIATE_ARRAY (octave_value *, OCTINTERP_API);
 
-NO_INSTANTIATE_ARRAY_SORT (octave::cdef_object);
-INSTANTIATE_ARRAY (octave::cdef_object);
+NO_INSTANTIATE_ARRAY_SORT (octave::cdef_object, OCTINTERP_API);
+INSTANTIATE_ARRAY (octave::cdef_object, OCTINTERP_API);
 #pragma GCC visibility pop
 
--- a/liboctave/array/Array-C.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-C.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -94,7 +94,7 @@
 
 template class octave_sort<Complex>;
 
-INSTANTIATE_ARRAY (Complex);
+INSTANTIATE_ARRAY (Complex, OCTAVE_API);
 
 template OCTAVE_API std::ostream& operator << (std::ostream&,
                                                const Array<Complex>&);
--- a/liboctave/array/Array-b.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-b.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -120,7 +120,7 @@
 
 template class octave_sort<bool>;
 
-INSTANTIATE_ARRAY (bool);
+INSTANTIATE_ARRAY (bool, OCTAVE_API);
 
 template OCTAVE_API std::ostream& operator << (std::ostream&,
                                                const Array<bool>&);
--- a/liboctave/array/Array-ch.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-ch.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -44,7 +44,7 @@
 
 template class octave_sort<char>;
 
-INSTANTIATE_ARRAY (char);
+INSTANTIATE_ARRAY (char, OCTAVE_API);
 
 template OCTAVE_API std::ostream& operator << (std::ostream&,
                                                const Array<char>&);
--- a/liboctave/array/Array-d.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-d.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -165,7 +165,7 @@
 
 template class octave_sort<double>;
 
-INSTANTIATE_ARRAY (double);
+INSTANTIATE_ARRAY (double, OCTAVE_API);
 
 template OCTAVE_API std::ostream& operator << (std::ostream&,
                                                const Array<double>&);
--- a/liboctave/array/Array-f.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-f.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -165,7 +165,7 @@
 
 template class octave_sort<float>;
 
-INSTANTIATE_ARRAY (float);
+INSTANTIATE_ARRAY (float, OCTAVE_API);
 
 template OCTAVE_API std::ostream& operator << (std::ostream&,
                                                const Array<float>&);
--- a/liboctave/array/Array-fC.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-fC.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -94,7 +94,7 @@
 
 template class octave_sort<FloatComplex>;
 
-INSTANTIATE_ARRAY (FloatComplex);
+INSTANTIATE_ARRAY (FloatComplex, OCTAVE_API);
 
 template OCTAVE_API std::ostream& operator << (std::ostream&,
                                                const Array<FloatComplex>&);
--- a/liboctave/array/Array-i.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-i.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -49,10 +49,10 @@
 template class octave_sort<long long>;
 #endif
 
-INSTANTIATE_ARRAY (int);
-INSTANTIATE_ARRAY (long);
+INSTANTIATE_ARRAY (int, OCTAVE_API);
+INSTANTIATE_ARRAY (long, OCTAVE_API);
 #if defined (OCTAVE_HAVE_LONG_LONG_INT)
-INSTANTIATE_ARRAY (long long);
+INSTANTIATE_ARRAY (long long, OCTAVE_API);
 #endif
 
 template class octave_sort<octave_int8>;
@@ -60,20 +60,20 @@
 template class octave_sort<octave_int32>;
 template class octave_sort<octave_int64>;
 
-INSTANTIATE_ARRAY (octave_int8);
-INSTANTIATE_ARRAY (octave_int16);
-INSTANTIATE_ARRAY (octave_int32);
-INSTANTIATE_ARRAY (octave_int64);
+INSTANTIATE_ARRAY (octave_int8, OCTAVE_API);
+INSTANTIATE_ARRAY (octave_int16, OCTAVE_API);
+INSTANTIATE_ARRAY (octave_int32, OCTAVE_API);
+INSTANTIATE_ARRAY (octave_int64, OCTAVE_API);
 
 template class octave_sort<octave_uint8>;
 template class octave_sort<octave_uint16>;
 template class octave_sort<octave_uint32>;
 template class octave_sort<octave_uint64>;
 
-INSTANTIATE_ARRAY (octave_uint8);
-INSTANTIATE_ARRAY (octave_uint16);
-INSTANTIATE_ARRAY (octave_uint32);
-INSTANTIATE_ARRAY (octave_uint64);
+INSTANTIATE_ARRAY (octave_uint8, OCTAVE_API);
+INSTANTIATE_ARRAY (octave_uint16, OCTAVE_API);
+INSTANTIATE_ARRAY (octave_uint32, OCTAVE_API);
+INSTANTIATE_ARRAY (octave_uint64, OCTAVE_API);
 
 #include "DiagArray2.h"
 #include "DiagArray2.cc"
--- a/liboctave/array/Array-idx-vec.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-idx-vec.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -39,6 +39,6 @@
 
 extern template class Array<octave_idx_type>;
 
-NO_INSTANTIATE_ARRAY_SORT (idx_vector);
+NO_INSTANTIATE_ARRAY_SORT (idx_vector, OCTAVE_API);
 
-INSTANTIATE_ARRAY (idx_vector);
+INSTANTIATE_ARRAY (idx_vector, OCTAVE_API);
--- a/liboctave/array/Array-s.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-s.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -44,7 +44,7 @@
 
 template class octave_sort<short>;
 
-INSTANTIATE_ARRAY (short);
+INSTANTIATE_ARRAY (short, OCTAVE_API);
 
 #include "DiagArray2.h"
 #include "DiagArray2.cc"
--- a/liboctave/array/Array-str.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-str.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -44,4 +44,4 @@
 
 template class octave_sort<std::string>;
 
-INSTANTIATE_ARRAY (std::string);
+INSTANTIATE_ARRAY (std::string, OCTAVE_API);
--- a/liboctave/array/Array-voidp.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array-voidp.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -40,6 +40,6 @@
 extern template class Array<idx_vector>;
 extern template class Array<octave_idx_type>;
 
-NO_INSTANTIATE_ARRAY_SORT (void *);
+NO_INSTANTIATE_ARRAY_SORT (void *, OCTAVE_API);
 
-INSTANTIATE_ARRAY (void *);
+INSTANTIATE_ARRAY (void *, OCTAVE_API);
--- a/liboctave/array/Array.cc	Fri Jan 01 18:56:25 2021 +0100
+++ b/liboctave/array/Array.cc	Sat Jan 02 15:46:16 2021 +0100
@@ -2466,59 +2466,59 @@
   return m;
 }
 
-#define NO_INSTANTIATE_ARRAY_SORT(T)                                    \
-  template <> Array<T>                                                  \
+#define NO_INSTANTIATE_ARRAY_SORT(T, API)                               \
+  template <> API Array<T>                                              \
   Array<T>::sort (int, sortmode) const                                  \
   {                                                                     \
     return *this;                                                       \
   }                                                                     \
-  template <> Array<T>                                                  \
+  template <> API Array<T>                                              \
   Array<T>::sort (Array<octave_idx_type> &sidx, int, sortmode) const    \
   {                                                                     \
     sidx = Array<octave_idx_type> ();                                   \
     return *this;                                                       \
   }                                                                     \
-  template <> sortmode                                                  \
-  Array<T>::issorted (sortmode) const                                  \
+  template <> API sortmode                                              \
+  Array<T>::issorted (sortmode) const                                   \
   {                                                                     \
     return UNSORTED;                                                    \
   }                                                                     \
-  Array<T>::compare_fcn_type                                            \
+  API Array<T>::compare_fcn_type                                        \
   safe_comparator (sortmode, const Array<T>&, bool)                     \
   {                                                                     \
     return nullptr;                                                     \
   }                                                                     \
-  template <> Array<octave_idx_type>                                    \
+  template <> API Array<octave_idx_type>                                \
   Array<T>::sort_rows_idx (sortmode) const                              \
   {                                                                     \
     return Array<octave_idx_type> ();                                   \
   }                                                                     \
-  template <> sortmode                                                  \
+  template <> API sortmode                                              \
   Array<T>::is_sorted_rows (sortmode) const                             \
   {                                                                     \
     return UNSORTED;                                                    \
   }                                                                     \
-  template <> octave_idx_type                                           \
+  template <> API octave_idx_type                                       \
   Array<T>::lookup (T const &, sortmode) const                          \
   {                                                                     \
     return 0;                                                           \
   }                                                                     \
-  template <> Array<octave_idx_type>                                    \
+  template <> API Array<octave_idx_type>                                \
   Array<T>::lookup (const Array<T>&, sortmode) const                    \
   {                                                                     \
     return Array<octave_idx_type> ();                                   \
   }                                                                     \
-  template <> octave_idx_type                                           \
+  template <> API octave_idx_type                                       \
   Array<T>::nnz (void) const                                            \
   {                                                                     \
     return 0;                                                           \
   }                                                                     \
-  template <> Array<octave_idx_type>                                    \
+  template <> API Array<octave_idx_type>                                \
   Array<T>::find (octave_idx_type, bool) const                          \
   {                                                                     \
     return Array<octave_idx_type> ();                                   \
   }                                                                     \
-  template <> Array<T>                                                  \
+  template <> API Array<T>                                              \
   Array<T>::nth_element (const idx_vector&, int) const {                \
     return Array<T> ();                                                 \
   }
@@ -2764,8 +2764,8 @@
   T::__xXxXx__ ();
 }
 
-#define INSTANTIATE_ARRAY(T)                            \
-  template <> void Array<T>::instantiation_guard () { } \
+#define INSTANTIATE_ARRAY(T, API)                           \
+  template <> API void Array<T>::instantiation_guard () { } \
   template class Array<T>
 
 // FIXME: is this used?