changeset 132:386772f4e12d

Clean up includes thanks to Octave header changes * octave_to_python.cc, py.cc, pytave.cc, python_to_octave.cc: Include project config.h first, do not undefine macros or include pytavedefs.h workaround. * pytavedefs.h: Delete. * Makefile.am (_pytave_la_SOURCES): Remove pytavedefs.h from the list.
author Mike Miller <mtmiller@octave.org>
date Mon, 04 Apr 2016 15:03:36 -0700
parents 3a35bb85ce52
children 058a964ae1de
files Makefile.am octave_to_python.cc py.cc pytave.cc pytavedefs.h python_to_octave.cc
diffstat 6 files changed, 15 insertions(+), 74 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Sun Sep 20 15:17:46 2015 +0200
+++ b/Makefile.am	Mon Apr 04 15:03:36 2016 -0700
@@ -12,7 +12,7 @@
 -l@BOOST_PYTHON_LIB@ -R @PYTAVE_OCTAVE_RPATH@
 
 _pytave_la_SOURCES = octave_to_python.cc pytave.cc python_to_octave.cc \
-arrayobjectdefs.h octave_to_python.h pytavedefs.h exceptions.h   \
+arrayobjectdefs.h octave_to_python.h exceptions.h   \
 exceptions.cc python_to_octave.h config.h
 
 all-am: py.oct
--- a/octave_to_python.cc	Sun Sep 20 15:17:46 2015 +0200
+++ b/octave_to_python.cc	Mon Apr 04 15:03:36 2016 -0700
@@ -18,22 +18,18 @@
  *  along with Pytave.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#if defined (HAVE_CONFIG_H)
+#  include <config.h>
+#endif
+
 #include <boost/python.hpp>
 #include <boost/type_traits/integral_constant.hpp>
 
-/* Both boost::python and octave define HAVE_STAT and HAVE_FSTAT.  Ideally,
-   they shouldn't expose their configuration in the header files, but they do.
-   This silences the compiler warning. */
-#undef HAVE_STAT
-#undef HAVE_FSTAT
-
-#include <octave/config.h>
 #include <octave/oct.h>
 #include <octave/ov.h>
 #include <octave/oct-map.h>
 
 #include <iostream>
-#include "pytavedefs.h"
 #include "arrayobjectdefs.h"
 #include "exceptions.h"
 #include "octave_to_python.h"
--- a/py.cc	Sun Sep 20 15:17:46 2015 +0200
+++ b/py.cc	Mon Apr 04 15:03:36 2016 -0700
@@ -20,23 +20,16 @@
 
 */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
+#if defined (HAVE_CONFIG_H)
+#  include <config.h>
 #endif
 
 #include <boost/python.hpp>
 #include <boost/python/numeric.hpp>
 
-/* Both boost::python and octave define HAVE_STAT and HAVE_FSTAT.  Ideally,
-   they shouldn't expose their configuration in the header files, but they do.
-   This silences the compiler warning. */
-#undef HAVE_STAT
-#undef HAVE_FSTAT
-
 #include <oct.h>
 
 #define PYTAVE_DO_DECLARE_SYMBOL
-#include "pytavedefs.h"
 #include "arrayobjectdefs.h"
 #include "exceptions.h"
 #include "python_to_octave.h"
--- a/pytave.cc	Sun Sep 20 15:17:46 2015 +0200
+++ b/pytave.cc	Mon Apr 04 15:03:36 2016 -0700
@@ -18,18 +18,14 @@
  *  along with Pytave.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#if defined (HAVE_CONFIG_H)
+#  include <config.h>
+#endif
+
 #include <boost/python.hpp>
 #include <boost/python/numeric.hpp>
 
-/* Both boost::python and octave define HAVE_STAT and HAVE_FSTAT.  Ideally,
-   they shouldn't expose their configuration in the header files, but they do.
-   This silences the compiler warning. */
-#undef HAVE_STAT
-#undef HAVE_FSTAT
-
-#include <octave/config.h>
 #include <octave/oct.h>
-
 #include <octave/oct-map.h>
 #include <octave/octave.h>
 #include <octave/ov.h>
@@ -45,8 +41,6 @@
 #include <sstream>
 #include <sys/types.h>
 
-#include "pytavedefs.h"
-
 #define PYTAVE_DO_DECLARE_SYMBOL
 #include "arrayobjectdefs.h"
 #include "exceptions.h"
--- a/pytavedefs.h	Sun Sep 20 15:17:46 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- *  Copyright 2008 David Grundberg, HÃ¥kan Fors Nilsson
- *
- *  This file is part of Pytave.
- *
- *  Pytave is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  Pytave is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with Pytave.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-// This file MUST NOT be included in header files.
-// It should be included after library includes.
-
-/* XXX: Octave leaks its internal config.h to the include files */
-#include "config.h.in"
-#ifndef HAVE_CONFIG_H
-#error Need config.h file
-#endif
-#include "config.h"
-
-/* Emacs
- * Local Variables:
- * fill-column:79
- * coding:utf-8
- * indent-tabs-mode:nil
- * c-basic-offset:3
- * End:
- * vim: set textwidth=79 expandtab shiftwidth=3 :
- */
--- a/python_to_octave.cc	Sun Sep 20 15:17:46 2015 +0200
+++ b/python_to_octave.cc	Mon Apr 04 15:03:36 2016 -0700
@@ -18,25 +18,21 @@
  *  along with Pytave.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#if defined (HAVE_CONFIG_H)
+#  include <config.h>
+#endif
+
 #include <iostream>
 #include <boost/python.hpp>
 #include <boost/python/numeric.hpp>
 #include <boost/type_traits/integral_constant.hpp>
 
-/* Both boost::python and octave define HAVE_STAT and HAVE_FSTAT.  Ideally,
-   they shouldn't expose their configuration in the header files, but they do.
-   This silences the compiler warning. */
-#undef HAVE_STAT
-#undef HAVE_FSTAT
-
-#include <octave/config.h>
 #include <octave/oct.h>
 #include <octave/oct-map.h>
 #include <octave/Cell.h>
 #include <octave/ov.h>
 #include <octave/Array.h>
 
-#include "pytavedefs.h"
 #include "arrayobjectdefs.h"
 #include "exceptions.h"