octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Header files


From: John W. Eaton
Subject: Re: Header files
Date: Wed, 26 Apr 2017 14:10:08 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

On 04/26/2017 01:20 PM, Rik wrote:

Looks like we were working independently on cleaning up the header files.
See my cset here http://hg.savannah.gnu.org/hgweb/octave/rev/3f1bf237908b.

Minimizing the #include statements so that we only include what is needed is a good goal.

I was just trying to get all the header files to compile individually. To do that, I was iterating over

  PATH=/tmp/install/dir/bin:$PATH
  rm -rf /tmp/install/dir
  make all && make install  ## with prefix=/tmp/install/dir

and then in a temporary directory, doing

  for ff in /tmp/install/dir/include/octave-4.3.0+/octave/*.h ; do
    f=$(basename $ff)
    echo $f
    echo "#include <$f>" > foo.cc
    mkoctfile -c foo.cc >& $f-log && rm -f $f-log
    rm -f foo.cc foo.o
  done

and adding forward declarations or additional #include lines until almost all the header files compiled when included individually. I tried to use forward declarations where possible.

The only two that don't work properly for me now are mexproto.h and ov-intx.h.

I'm not sure how to deal with mxArray in mexproto.h. It is declared as a class when mexproto.h is included in the Octave sources, or as void for including in external code (the type is supposed to be opaque and users aren't supposed to access it except through function calls).

For ov-intx.h, a number of macros are supposed to be defined before it is included. It's not really supposed to be included separately. That the ov-{u,}int{8,16,23,64}.h files work is good enough.

Maybe it would be worth including some variation of these commands in a Makefile rule, at least as a maintainer mode option.

jwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]