Mercurial > pytave
changeset 141:4e5a620758fc
Use consistent Octave style for header files
* arrayobjectdefs.h, exceptions.h, octave_to_python.h, python_to_octave.h:
Use Octave style for include guards and block comments. Include external
header files for types used in declarations.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Mon, 04 Apr 2016 17:48:33 -0700 |
parents | d9fa0b60e889 |
children | dc2876fdbfaf |
files | arrayobjectdefs.h exceptions.h octave_to_python.h python_to_octave.h |
diffstat | 4 files changed, 36 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/arrayobjectdefs.h Mon Apr 04 17:41:15 2016 -0700 +++ b/arrayobjectdefs.h Mon Apr 04 17:48:33 2016 -0700 @@ -20,17 +20,24 @@ */ -/* If your extension does not reside in a single file, there is an - * additional step that is necessary. Be sure to define the symbol - * PY_ARRAY_UNIQUE_SYMBOL to some name (the same name in all the files - * comprising the extension), upstream from the include of - * arrayobject.h. Typically this would be in some header file that is - * included before arrayobject.h. - */ -#ifndef PYTAVE_DO_DECLARE_SYMBOL -#define NO_IMPORT_ARRAY +#if ! defined (pytave_arrayobjectdefs_h) +#define pytave_arrayobjectdefs_h 1 + +// If your extension does not reside in a single file, there is an +// additional step that is necessary. Be sure to define the symbol +// PY_ARRAY_UNIQUE_SYMBOL to some name (the same name in all the files +// comprising the extension), upstream from the include of +// arrayobject.h. Typically this would be in some header file that is +// included before arrayobject.h. + +#if ! defined (PYTAVE_DO_DECLARE_SYMBOL) +# define NO_IMPORT_ARRAY #endif + #define PY_ARRAY_UNIQUE_SYMBOL pytave_array_symbol + #include <Python.h> #include <numpy/npy_no_deprecated_api.h> #include <numpy/arrayobject.h> + +#endif
--- a/exceptions.h Mon Apr 04 17:41:15 2016 -0700 +++ b/exceptions.h Mon Apr 04 17:48:33 2016 -0700 @@ -20,8 +20,11 @@ */ -#ifndef PYTAVE_EXCEPTIONS_H -#define PYTAVE_EXCEPTIONS_H +#if ! defined (pytave_exceptions_h) +#define pytave_exceptions_h + +#include <Python.h> +#include <string> namespace pytave { @@ -138,4 +141,4 @@ } -#endif /* PYTAVE_EXCEPTIONS_H */ +#endif
--- a/octave_to_python.h Mon Apr 04 17:41:15 2016 -0700 +++ b/octave_to_python.h Mon Apr 04 17:48:33 2016 -0700 @@ -20,8 +20,12 @@ */ -#ifndef OCTAVE_TO_PYTHON_H -#define OCTAVE_TO_PYTHON_H +#if ! defined (pytave_octave_to_python_h) +#define pytave_octave_to_python_h + +#include <boost/python.hpp> +#include <ov.h> +#include <ovl.h> namespace pytave { void octvalue_to_pyobj(boost::python::object &py_object, @@ -30,4 +34,4 @@ const octave_value_list &octave_list); } -#endif /* OCTAVE_TO_PYTHON_H */ +#endif
--- a/python_to_octave.h Mon Apr 04 17:41:15 2016 -0700 +++ b/python_to_octave.h Mon Apr 04 17:48:33 2016 -0700 @@ -20,8 +20,12 @@ */ -#ifndef PYTHON_TO_OCTAVE_H -#define PYTHON_TO_OCTAVE_H +#if ! defined (pytave_python_to_octave_h) +#define pytave_python_to_octave_h + +#include <boost/python.hpp> +#include <ov.h> +#include <ovl.h> namespace pytave { void pyobj_to_octvalue(octave_value &oct_value, @@ -30,4 +34,4 @@ const boost::python::tuple &python_tuple); } -#endif /* PYTHON_TO_OCTAVE_H */ +#endif