diff options
author | Josh Blum | 2012-09-13 18:57:35 -0700 |
---|---|---|
committer | Josh Blum | 2012-09-13 18:57:35 -0700 |
commit | f1c0a7e2a70247697feec42f25c792ddc9068f07 (patch) | |
tree | ef36a35a69c905e868f9dea55e90c879db773b52 /include/gnuradio | |
parent | 87cd4fe7179a55f1ea34ea90744017c403838542 (diff) | |
download | sandhi-f1c0a7e2a70247697feec42f25c792ddc9068f07.tar.gz sandhi-f1c0a7e2a70247697feec42f25c792ddc9068f07.tar.bz2 sandhi-f1c0a7e2a70247697feec42f25c792ddc9068f07.zip |
redo gr type compat header, it has 2 purposes
to be included by swig and bring in hpp files
and to provide gr_<stdint> typedefs
This is for backwards compat since really old blocks use these typedefs
(should totally sed these out)
Diffstat (limited to 'include/gnuradio')
-rw-r--r-- | include/gnuradio/gr_block.h | 4 | ||||
-rw-r--r-- | include/gnuradio/gr_types.h | 91 |
2 files changed, 37 insertions, 58 deletions
diff --git a/include/gnuradio/gr_block.h b/include/gnuradio/gr_block.h index 5b3e9f2..038f1a5 100644 --- a/include/gnuradio/gr_block.h +++ b/include/gnuradio/gr_block.h @@ -24,6 +24,10 @@ #include <gr_tags.h> #include <string> +typedef std::vector<int> gr_vector_int; +typedef std::vector<void *> gr_vector_void_star; +typedef std::vector<const void *> gr_vector_const_void_star; + struct GRAS_API gr_block : gnuradio::Block { diff --git a/include/gnuradio/gr_types.h b/include/gnuradio/gr_types.h index f7d1cee..0da08cc 100644 --- a/include/gnuradio/gr_types.h +++ b/include/gnuradio/gr_types.h @@ -1,70 +1,45 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio 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, or (at your option) - * any later version. - * - * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ +// +// Copyright 2012 Josh Blum +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with io_sig program. If not, see <http://www.gnu.org/licenses/>. -#ifndef INCLUDED_GR_TYPES_H -#define INCLUDED_GR_TYPES_H +#ifndef INCLUDED_GRNURADIO_TYPES_H +#define INCLUDED_GRNURADIO_TYPES_H +// this section is to satisfy swig includes for gnuradio.i +// since gnuradio.i includes gr_types.h, we only have to edit this file #include <gnuradio/io_signature.hpp> #include <gnuradio/element.hpp> #include <gnuradio/block.hpp> #include <gnuradio/top_block.hpp> #include <gnuradio/hier_block.hpp> -#include <gr_core_api.h> -#include <boost/shared_ptr.hpp> -#include <vector> -#include <stddef.h> // size_t +// and gnuradio apparently needs its own typedefs for stdint... +#ifdef __cplusplus -#include <gr_complex.h> +#include <boost/cstdint.hpp> +typedef boost::int16_t gr_int16; +typedef boost::int32_t gr_int32; +typedef boost::int64_t gr_int64; +typedef boost::uint16_t gr_uint16; +typedef boost::uint32_t gr_uint32; +typedef boost::uint64_t gr_uint64; -typedef std::vector<int> gr_vector_int; -typedef std::vector<float> gr_vector_float; -typedef std::vector<double> gr_vector_double; -typedef std::vector<void *> gr_vector_void_star; -typedef std::vector<const void *> gr_vector_const_void_star; +#include <complex> +typedef std::complex<float> gr_complex; +typedef std::complex<double> gr_complexd; -/* - * #include <config.h> must be placed beforehand - * in the source file including gr_types.h for - * the following to work correctly - */ -#ifdef HAVE_STDINT_H -#include <stdint.h> -typedef int16_t gr_int16; -typedef int32_t gr_int32; -typedef int64_t gr_int64; -typedef uint16_t gr_uint16; -typedef uint32_t gr_uint32; -typedef uint64_t gr_uint64; -#else -/* - * Note: these defaults may be wrong on 64-bit systems - */ -typedef short gr_int16; -typedef int gr_int32; -typedef long long gr_int64; -typedef unsigned short gr_uint16; -typedef unsigned int gr_uint32; -typedef unsigned long long gr_uint64; -#endif /* HAVE_STDINT_H */ +#endif -#endif /* INCLUDED_GR_TYPES_H */ +#endif /* INCLUDED_GRNURADIO_TYPES_H */ |