Mercurial > hg > octave-avbm
changeset 9648:11844593875a
eliminate oct-dlldefs.h and oct-types.h
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 17 Sep 2009 17:25:37 -0400 |
parents | 54f45f883a53 |
children | d0e2aa1974e9 |
files | ChangeLog configure.ac libcruft/ChangeLog libcruft/misc/Makefile.in libcruft/misc/oct-dlldefs.h liboctave/ChangeLog liboctave/DAEFunc.h liboctave/Makefile.in liboctave/MatrixType.h liboctave/base-aepbal.h liboctave/dim-vector.h liboctave/lo-specfun.h liboctave/lo-utils.h liboctave/mx-op-decl.h liboctave/oct-inttypes.h liboctave/oct-types.h.in liboctave/randgamma.h liboctave/randmtzig.h liboctave/randpoisson.h src/gripes.h |
diffstat | 20 files changed, 125 insertions(+), 183 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-17 John W. Eaton <jwe@octave.org> + + * configure.ac: Also AC_DEFINE OCTAAVE_IDX_TYPE. + (AH_BOTTOM): Include contents of libcruft/misc/oct-dlldefs.h and + liboctave/oct-types.h here. Use C-style comments. + (AC_CONFIG_FILES): Remove liboctave/oct-types.h from the list. + 2009-09-15 John W. Eaton <jwe@octave.org> * configure.ac: Rename from configure.in.
--- a/configure.ac +++ b/configure.ac @@ -165,6 +165,8 @@ fi fi AC_SUBST(OCTAVE_IDX_TYPE) +AC_DEFINE_UNQUOTED(OCTAVE_IDX_TYPE, $OCTAVE_IDX_TYPE, + [Define to the type of octave_idx_type (64 or 32 bit signed integer)]) if $USE_64_BIT_IDX_T; then AC_DEFINE(USE_64_BIT_IDX_T, 1, [Define if using 64-bit integers for array dimensions and indexing]) fi @@ -2012,28 +2014,115 @@ #define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT #endif -// To be able to use long doubles for 64-bit mixed arithmetics, we need them at -// least 80 bits wide and we need roundl declared in math.h. -// FIXME -- maybe substitute this by a more precise check in the future. +/* To be able to use long doubles for 64-bit mixed arithmetics, we need + them at least 80 bits wide and we need roundl declared in math.h. + FIXME -- maybe substitute this by a more precise check in the future. */ #if (SIZEOF_LONG_DOUBLE >= 10) && defined (HAVE_ROUNDL) #define OCTAVE_INT_USE_LONG_DOUBLE #endif #define OCTAVE_EMPTY_CPP_ARG -// Octave is currently unable to use FFTW unless both float -// and double versions are both available. +/* Octave is currently unable to use FFTW unless both float + and double versions are both available. */ #if defined (HAVE_FFTW3) && defined (HAVE_FFTW3F) #define HAVE_FFTW #endif -// Backward compatibility. +/* Backward compatibility. */ #if defined (HAVE_Z) #define HAVE_ZLIB #endif -#include "oct-dlldefs.h" -#include "oct-types.h" +/* oct-dlldefs.h */ + +#if defined (_MSC_VER) +#define OCTAVE_EXPORT __declspec(dllexport) +#define OCTAVE_IMPORT __declspec(dllimport) +#else +/* All other compilers, at least for now. */ +#define OCTAVE_EXPORT +#define OCTAVE_IMPORT +#endif + +/* API macro for libcruft */ +#ifdef CRUFT_DLL +#define CRUFT_API OCTAVE_EXPORT +#else +#define CRUFT_API OCTAVE_IMPORT +#endif + +/* API macro for liboctave */ +#ifdef OCTAVE_DLL +#define OCTAVE_API OCTAVE_EXPORT +#else +#define OCTAVE_API OCTAVE_IMPORT +#endif + +/* API macro for src */ +#ifdef OCTINTERP_DLL +#define OCTINTERP_API OCTAVE_EXPORT +#else +#define OCTINTERP_API OCTAVE_IMPORT +#endif + +/* API macro for src/graphics */ +#ifdef OCTGRAPHICS_DLL +#define OCTGRAPHICS_API OCTAVE_EXPORT +#else +#define OCTGRAPHICS_API OCTAVE_IMPORT +#endif + +/* oct-types.h */ + +typedef OCTAVE_IDX_TYPE octave_idx_type; + +#if defined (HAVE_STDINT_H) +#include <stdint.h> +#elif defined (HAVE_INTTYPES_H) +#include <inttypes.h> +#else + +#if defined (HAVE_LIMITS_H) +#include <limits.h> +#endif + +#if CHAR_BIT == 8 +typedef signed char int8_t; +typedef unsigned char uint8_t; +#else +#error "CHAR_BIT is not 8!" +#endif + +#if SIZEOF_SHORT == 2 +typedef short int16_t; +typedef unsigned short uint16_t; +#elif SIZEOF_INT == 2 +typedef long int16_t; +typedef unsigned long uint16_t; +#else +#error "No 2 byte integer type found!" +#endif + +#if SIZEOF_INT == 4 +typedef int int32_t; +typedef unsigned int uint32_t; +#elif SIZEOF_LONG == 4 +typedef long int32_t; +typedef unsigned long uint32_t; +#else +#error "No 4 byte integer type found!" +#endif + +#if SIZEOF_LONG == 8 +typedef long int64_t; +typedef unsigned long uint64_t; +#elif SIZEOF_LONG_LONG == 8 +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#endif ]) ### Do the substitutions in all the Makefiles. @@ -2050,7 +2139,7 @@ doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile examples/Makefile examples/@polynomial/Makefile examples/@FIRfilter/Makefile liboctave/Makefile - liboctave/oct-types.h src/Makefile src/mxarray.h libcruft/Makefile + src/Makefile src/mxarray.h libcruft/Makefile libcruft/Makerules libcruft/amos/Makefile libcruft/blas/Makefile libcruft/daspk/Makefile libcruft/dasrt/Makefile libcruft/dassl/Makefile libcruft/fftpack/Makefile
--- a/libcruft/ChangeLog +++ b/libcruft/ChangeLog @@ -1,3 +1,8 @@ +2009-09-17 John W. Eaton <jwe@octave.org> + + * misc/oct-dlldefs.h: Delete. + * misc/Makefile.in (INCLUDES): Remove oct-dlldefs.h from the list. + 2009-08-05 John W. Eaton <jwe@octave.org> * Makefile.in (LINK_DEPS): Omit $(FFTW_LIBS) from the list.
--- a/libcruft/misc/Makefile.in +++ b/libcruft/misc/Makefile.in @@ -35,7 +35,7 @@ MAKEDEPS := $(patsubst %.c, %.d, $(CSRC)) $(patsubst %.cc, %.d, $(CXXSRC)) -INCLUDES := f77-fcn.h lo-error.h oct-dlldefs.h quit.h +INCLUDES := f77-fcn.h lo-error.h quit.h SPECIAL:= d1mach-tst.for $(INCLUDES)
deleted file mode 100644 --- a/libcruft/misc/oct-dlldefs.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - -Copyright (C) 2006, 2007, 2008 John W. Eaton - -This file is part of Octave. - -Octave 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. - -Octave 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 Octave; see the file COPYING. If not, see -<http://www.gnu.org/licenses/>. - -*/ - -#if !defined (octave_dlldefs_h) -#define octave_dlldefs_h 1 - -#if defined (_MSC_VER) -#define OCTAVE_EXPORT __declspec(dllexport) -#define OCTAVE_IMPORT __declspec(dllimport) -#else -/* All other compilers, at least for now. */ -#define OCTAVE_EXPORT -#define OCTAVE_IMPORT -#endif - -/* API macro for libcruft */ -#ifdef CRUFT_DLL -#define CRUFT_API OCTAVE_EXPORT -#else -#define CRUFT_API OCTAVE_IMPORT -#endif - -/* API macro for liboctave */ -#ifdef OCTAVE_DLL -#define OCTAVE_API OCTAVE_EXPORT -#else -#define OCTAVE_API OCTAVE_IMPORT -#endif - -/* API macro for src */ -#ifdef OCTINTERP_DLL -#define OCTINTERP_API OCTAVE_EXPORT -#else -#define OCTINTERP_API OCTAVE_IMPORT -#endif - -/* API macro for src/graphics */ -#ifdef OCTGRAPHICS_DLL -#define OCTGRAPHICS_API OCTAVE_EXPORT -#else -#define OCTGRAPHICS_API OCTAVE_IMPORT -#endif - -#endif - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,14 @@ +2009-09-17 John W. Eaton <jwe@octave.org> + + * oct-types.h.in: Delete. + * Makefile.in (BUILT_INCLUDES, DISTFILES): Remove oct-types.h.in + from the list. + (distclean, maintainer-clean): + * DAEFunc.h, MatrixType.h, base-aepbal.h, dim-vector.h, + lo-specfun.h, lo-utils.h, mx-op-decl.h, oct-inttypes.h, + randgamma.h, randmtzig.h, randpoisson.h: + Don't include oct-types.h. + 2009-09-16 Jaroslav Hajek <highegg@gmail.com> * oct-rand.cc (octave_rand::do_matrix, do_nd_array, do_vector):
--- a/liboctave/DAEFunc.h +++ b/liboctave/DAEFunc.h @@ -24,8 +24,6 @@ #if !defined (octave_DAEFunc_h) #define octave_DAEFunc_h 1 -#include "oct-types.h" - class Matrix; class ColumnVector;
--- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -104,7 +104,7 @@ sparse-util.h sun-utils.h sysdir.h systime.h syswait.h \ $(MATRIX_INC) -BUILT_INCLUDES := oct-types.h mx-ops.h \ +BUILT_INCLUDES := mx-ops.h \ $(OPT_INC) \ $(MX_OP_INC) \ $(VX_OP_INC) \ @@ -200,7 +200,7 @@ INCLUDES_FOR_INSTALL := $(INCLUDES) $(BUILT_INCLUDES) $(TEMPLATE_SRC) $(EXTRAS) DISTFILES := $(addprefix $(srcdir)/, Makefile.in ChangeLog mk-ops.awk \ - mx-ops vx-ops sparse-mk-ops.awk sparse-mx-ops oct-types.h.in \ + mx-ops vx-ops sparse-mk-ops.awk sparse-mx-ops \ $(TEMPLATE_SRC) \ $(LIBOCTAVE_CXX_SOURCES) \ $(LIBOCT_READLINE_SOURCES) \ @@ -365,7 +365,7 @@ distclean maintainer-clean: clean rm -f tags TAGS - rm -f Makefile so_locations oct-types.h $(PREREQ) + rm -f Makefile so_locations $(PREREQ) .PHONY: distclean maintainer-clean dist: $(PREREQ)
--- a/liboctave/MatrixType.h +++ b/liboctave/MatrixType.h @@ -24,8 +24,6 @@ #if !defined (octave_MatrixType_h) #define octave_MatrixType_h -#include "oct-types.h" - class Matrix; class ComplexMatrix; class FloatMatrix;
--- a/liboctave/base-aepbal.h +++ b/liboctave/base-aepbal.h @@ -23,8 +23,6 @@ #if !defined (octave_base_aepbal_h) #define octave_base_aepbal_h 1 -#include "oct-types.h" - template <class MatrixT, class VectorT> class base_aepbal {
--- a/liboctave/dim-vector.h +++ b/liboctave/dim-vector.h @@ -30,7 +30,6 @@ #include <string> #include "lo-error.h" -#include "oct-types.h" // Rationale: This implementation is more tricky than Array, but the big plus // is that dim_vector requires only one allocation instead of two.
--- a/liboctave/lo-specfun.h +++ b/liboctave/lo-specfun.h @@ -25,7 +25,6 @@ #define octave_liboctave_specfun_h 1 #include "oct-cmplx.h" -#include "oct-types.h" #include "ArrayN.h" template <class T> class Array2;
--- a/liboctave/lo-utils.h +++ b/liboctave/lo-utils.h @@ -30,7 +30,6 @@ #include <string> #include "oct-cmplx.h" -#include "oct-types.h" #include "syswait.h" extern OCTAVE_API octave_idx_type NINTbig (double x);
--- a/liboctave/mx-op-decl.h +++ b/liboctave/mx-op-decl.h @@ -25,8 +25,6 @@ #if !defined (octave_mx_op_decl_h) #define octave_mx_op_decl_h 1 -#include "oct-types.h" - #define BIN_OP_DECL(R, OP, X, Y, API) \ extern API R OP (const X&, const Y&)
--- a/liboctave/oct-inttypes.h +++ b/liboctave/oct-inttypes.h @@ -32,7 +32,6 @@ #include "lo-traits.h" #include "lo-math.h" -#include "oct-types.h" #include "lo-mappers.h" #ifdef OCTAVE_INT_USE_LONG_DOUBLE
deleted file mode 100644 --- a/liboctave/oct-types.h.in +++ /dev/null @@ -1,81 +0,0 @@ -/* - -Copyright (C) 2005, 2006, 2007 John W. Eaton - -This file is part of Octave. - -Octave 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. - -Octave 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 Octave; see the file COPYING. If not, see -<http://www.gnu.org/licenses/>. - -*/ - -#if !defined (octave_oct_types_h) -#define octave_oct_types_h 1 - -typedef @OCTAVE_IDX_TYPE@ octave_idx_type; - -#if defined (HAVE_STDINT_H) -#include <stdint.h> -#elif defined (HAVE_INTTYPES_H) -#include <inttypes.h> -#else - -#if defined (HAVE_LIMITS_H) -#include <limits.h> -#endif - -#if CHAR_BIT == 8 -typedef signed char int8_t; -typedef unsigned char uint8_t; -#else -#error "CHAR_BIT is not 8!" -#endif - -#if SIZEOF_SHORT == 2 -typedef short int16_t; -typedef unsigned short uint16_t; -#elif SIZEOF_INT == 2 -typedef long int16_t; -typedef unsigned long uint16_t; -#else -#error "No 2 byte integer type found!" -#endif - -#if SIZEOF_INT == 4 -typedef int int32_t; -typedef unsigned int uint32_t; -#elif SIZEOF_LONG == 4 -typedef long int32_t; -typedef unsigned long uint32_t; -#else -#error "No 4 byte integer type found!" -#endif - -#if SIZEOF_LONG == 8 -typedef long int64_t; -typedef unsigned long uint64_t; -#elif SIZEOF_LONG_LONG == 8 -typedef long long int64_t; -typedef unsigned long long uint64_t; -#endif - -#endif - -#endif - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/
--- a/liboctave/randgamma.h +++ b/liboctave/randgamma.h @@ -25,8 +25,6 @@ #ifndef _RANDGAMMA_H -#include "oct-types.h" - #ifdef __cplusplus extern "C" { #endif
--- a/liboctave/randmtzig.h +++ b/liboctave/randmtzig.h @@ -64,8 +64,6 @@ #ifndef _RANDMTZIG_H #define _RANDMTZIG_H -#include "oct-types.h" - #define MT_N 624 #ifdef __cplusplus