changeset 23442:53f5f8231c37

allow most header files to be compiled separately * build-aux/mk-opts.pl: Include <limits> in generated header files. * file-io.h, ls-hdf5.h, ls-mat-ascii.h, ls-mat4.h, ls-mat5.h, ls-oct-binary.h, ls-oct-text.h, ls-utils.h, mxarray.in.h, octave-link.h, octave-preserve-stream-state.h, pt-check.h, pt-tm-const.h, DAERTFunc.h, aepbalance.h, eigs-base.h, Sparse-diag-op-defs.h, Sparse-op-defs.h, Sparse-perm-op-defs.h, action-container.h, oct-rl-edit.h, url-transfer.h: Include additional headers or use forward declarations to allow successful compilation of the file by itself.
author John W. Eaton <jwe@octave.org>
date Wed, 26 Apr 2017 01:20:50 -0400
parents 6bd180614330
children 3f1bf237908b
files build-aux/mk-opts.pl libinterp/corefcn/file-io.h libinterp/corefcn/ls-hdf5.h libinterp/corefcn/ls-mat-ascii.h libinterp/corefcn/ls-mat4.h libinterp/corefcn/ls-mat5.h libinterp/corefcn/ls-oct-binary.h libinterp/corefcn/ls-oct-text.h libinterp/corefcn/ls-utils.h libinterp/corefcn/mxarray.in.h libinterp/corefcn/octave-link.h libinterp/corefcn/octave-preserve-stream-state.h libinterp/parse-tree/pt-check.h libinterp/parse-tree/pt-tm-const.h liboctave/numeric/DAERTFunc.h liboctave/numeric/aepbalance.h liboctave/numeric/eigs-base.h liboctave/operators/Sparse-diag-op-defs.h liboctave/operators/Sparse-op-defs.h liboctave/operators/Sparse-perm-op-defs.h liboctave/util/action-container.h liboctave/util/oct-rl-edit.h liboctave/util/url-transfer.h
diffstat 23 files changed, 68 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/build-aux/mk-opts.pl	Wed Apr 26 01:05:39 2017 -0400
+++ b/build-aux/mk-opts.pl	Wed Apr 26 01:20:50 2017 -0400
@@ -377,6 +377,8 @@
 #include <cfloat>
 #include <cmath>
 
+#include <limits>
+
 $INCLUDE
 
 class
--- a/libinterp/corefcn/file-io.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/file-io.h	Wed Apr 26 01:20:50 2017 -0400
@@ -27,6 +27,8 @@
 
 #include "octave-config.h"
 
+#include <string>
+
 extern OCTINTERP_API void initialize_file_io (void);
 
 extern OCTINTERP_API void close_files (void);
--- a/libinterp/corefcn/ls-hdf5.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/ls-hdf5.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,7 +25,10 @@
 
 #include "octave-config.h"
 
+#include <iostream>
+
 #include "oct-hdf5-types.h"
+#include "ov.h"
 
 // first, we need to define our own dummy stream subclass, since
 // HDF5 needs to do its own file i/o
--- a/libinterp/corefcn/ls-mat-ascii.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/ls-mat-ascii.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,11 @@
 
 #include "octave-config.h"
 
+#include <iosfwd>
+#include <string>
+
+class octave_value;
+
 extern std::string
 read_mat_ascii_data (std::istream& is, const std::string& filename,
                      octave_value& tc);
--- a/libinterp/corefcn/ls-mat4.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/ls-mat4.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,12 @@
 
 #include "octave-config.h"
 
+#include <iosfwd>
+
+#include "mach-info.h"
+
+class octave_value;
+
 extern octave::mach_info::float_format
 mopt_digit_to_float_format (int mach);
 
--- a/libinterp/corefcn/ls-mat5.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/ls-mat5.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,11 @@
 
 #include "octave-config.h"
 
+#include <iosfwd>
+#include <string>
+
+class octave_value;
+
 enum mat5_data_type
 {
   miINT8 = 1,                 // 8 bit signed
--- a/libinterp/corefcn/ls-oct-binary.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/ls-oct-binary.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,12 @@
 
 #include "octave-config.h"
 
+#include <iosfwd>
+
+#include "mach-info.h"
+
+class octave_value;
+
 extern OCTINTERP_API bool
 save_binary_data (std::ostream& os, const octave_value& tc,
                   const std::string& name, const std::string& doc,
--- a/libinterp/corefcn/ls-oct-text.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/ls-oct-text.h	Wed Apr 26 01:20:50 2017 -0400
@@ -34,6 +34,8 @@
 
 #include "ls-ascii-helper.h"
 
+class octave_value;
+
 // Flag for cell elements
 #define CELL_ELT_TAG "<cell-element>"
 
--- a/libinterp/corefcn/ls-utils.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/ls-utils.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,8 @@
 
 #include "octave-config.h"
 
+#include "data-conv.h"
+
 extern save_type
 get_save_type (double max_val, double min_val);
 
--- a/libinterp/corefcn/mxarray.in.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/mxarray.in.h	Wed Apr 26 01:20:50 2017 -0400
@@ -100,6 +100,7 @@
 #include "error.h"
 
 class octave_value;
+class dim_vector;
 
 #define DO_MUTABLE_METHOD(RET_T, METHOD_CALL)   \
   RET_T retval = rep->METHOD_CALL;              \
--- a/libinterp/corefcn/octave-link.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/octave-link.h	Wed Apr 26 01:20:50 2017 -0400
@@ -27,6 +27,7 @@
 
 #include "octave-config.h"
 
+#include <list>
 #include <string>
 
 #include "oct-mutex.h"
--- a/libinterp/corefcn/octave-preserve-stream-state.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/corefcn/octave-preserve-stream-state.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,8 @@
 
 #include "octave-config.h"
 
+#include <ios>
+
 class
 octave_preserve_stream_state
 {
--- a/libinterp/parse-tree/pt-check.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/parse-tree/pt-check.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,8 @@
 
 #include "octave-config.h"
 
+#include <string>
+
 #include "pt-walk.h"
 
 namespace octave
--- a/libinterp/parse-tree/pt-tm-const.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/libinterp/parse-tree/pt-tm-const.h	Wed Apr 26 01:20:50 2017 -0400
@@ -36,10 +36,12 @@
 #include "oct-map.h"
 #include "ov.h"
 #include "ovl.h"
+#include "pt-arg-list.h"
 
 namespace octave
 {
   class tree_evaluator;
+  class tree_matrix;
 
   // General matrices.  This list type is much more work to handle than
   // constant matrices, but it allows us to construct matrices from
--- a/liboctave/numeric/DAERTFunc.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/liboctave/numeric/DAERTFunc.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,7 @@
 
 #include "octave-config.h"
 
+#include "DAEFunc.h"
 #include "dMatrix.h"
 
 class
--- a/liboctave/numeric/aepbalance.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/liboctave/numeric/aepbalance.h	Wed Apr 26 01:20:50 2017 -0400
@@ -26,6 +26,8 @@
 
 #include "octave-config.h"
 
+#include <algorithm>
+
 namespace octave
 {
   namespace math
--- a/liboctave/numeric/eigs-base.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/liboctave/numeric/eigs-base.h	Wed Apr 26 01:20:50 2017 -0400
@@ -27,6 +27,8 @@
 
 #include <iosfwd>
 
+#include "oct-cmplx.h"
+
 class ColumnVector;
 class ComplexColumnVector;
 class Matrix;
--- a/liboctave/operators/Sparse-diag-op-defs.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/liboctave/operators/Sparse-diag-op-defs.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,8 @@
 
 #include "octave-config.h"
 
+#include "lo-array-errwarn.h"
+
 // Matrix multiplication
 
 template <typename RT, typename DM, typename SM>
--- a/liboctave/operators/Sparse-op-defs.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/liboctave/operators/Sparse-op-defs.h	Wed Apr 26 01:20:50 2017 -0400
@@ -28,8 +28,9 @@
 #include "octave-config.h"
 
 #include "Array-util.h"
+#include "lo-array-errwarn.h"
+#include "mx-inlines.cc"
 #include "oct-locbuf.h"
-#include "mx-inlines.cc"
 
 // sparse matrix by scalar operations.
 
--- a/liboctave/operators/Sparse-perm-op-defs.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/liboctave/operators/Sparse-perm-op-defs.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,12 @@
 
 #include "octave-config.h"
 
+#include "PermMatrix.h"
+#include "lo-array-errwarn.h"
+#include "oct-locbuf.h"
+#include "oct-sort.h"
+#include "quit.h"
+
 // Matrix multiplication
 
 template <typename SM>
--- a/liboctave/util/action-container.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/liboctave/util/action-container.h	Wed Apr 26 01:20:50 2017 -0400
@@ -26,6 +26,8 @@
 
 #include "octave-config.h"
 
+#include <cstddef>
+
 // This class allows registering actions in a list for later
 // execution, either explicitly or when the container goes out of
 // scope.
--- a/liboctave/util/oct-rl-edit.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/liboctave/util/oct-rl-edit.h	Wed Apr 26 01:20:50 2017 -0400
@@ -25,6 +25,12 @@
 
 #include "octave-config.h"
 
+#if defined (__cplusplus)
+#  include <cstdio>
+#else
+#  include <stdio.h>
+#endif
+
 typedef int (*rl_startup_hook_fcn_ptr) (void);
 
 typedef int (*rl_pre_input_hook_fcn_ptr) (void);
--- a/liboctave/util/url-transfer.h	Wed Apr 26 01:05:39 2017 -0400
+++ b/liboctave/util/url-transfer.h	Wed Apr 26 01:20:50 2017 -0400
@@ -33,6 +33,10 @@
 #include <iosfwd>
 #include <string>
 
+#include "str-vec.h"
+
+template <typename T> class Array;
+
 namespace octave
 {
   class