# HG changeset patch # User John W. Eaton # Date 1253222737 14400 # Node ID 11844593875aef155cd078bd76147159d0458997 # Parent 54f45f883a53a7805039d3906ad461856d965db5 eliminate oct-dlldefs.h and oct-types.h diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-17 John W. Eaton + + * 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 * configure.ac: Rename from configure.in. diff --git a/configure.ac b/configure.ac --- 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 +#elif defined (HAVE_INTTYPES_H) +#include +#else + +#if defined (HAVE_LIMITS_H) +#include +#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 diff --git a/libcruft/ChangeLog b/libcruft/ChangeLog --- a/libcruft/ChangeLog +++ b/libcruft/ChangeLog @@ -1,3 +1,8 @@ +2009-09-17 John W. Eaton + + * misc/oct-dlldefs.h: Delete. + * misc/Makefile.in (INCLUDES): Remove oct-dlldefs.h from the list. + 2009-08-05 John W. Eaton * Makefile.in (LINK_DEPS): Omit $(FFTW_LIBS) from the list. diff --git a/libcruft/misc/Makefile.in b/libcruft/misc/Makefile.in --- 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) diff --git a/libcruft/misc/oct-dlldefs.h b/libcruft/misc/oct-dlldefs.h 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 -. - -*/ - -#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: *** -*/ diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,14 @@ +2009-09-17 John W. Eaton + + * 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 * oct-rand.cc (octave_rand::do_matrix, do_nd_array, do_vector): diff --git a/liboctave/DAEFunc.h b/liboctave/DAEFunc.h --- 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; diff --git a/liboctave/Makefile.in b/liboctave/Makefile.in --- 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) diff --git a/liboctave/MatrixType.h b/liboctave/MatrixType.h --- 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; diff --git a/liboctave/base-aepbal.h b/liboctave/base-aepbal.h --- 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 base_aepbal { diff --git a/liboctave/dim-vector.h b/liboctave/dim-vector.h --- a/liboctave/dim-vector.h +++ b/liboctave/dim-vector.h @@ -30,7 +30,6 @@ #include #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. diff --git a/liboctave/lo-specfun.h b/liboctave/lo-specfun.h --- 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 Array2; diff --git a/liboctave/lo-utils.h b/liboctave/lo-utils.h --- a/liboctave/lo-utils.h +++ b/liboctave/lo-utils.h @@ -30,7 +30,6 @@ #include #include "oct-cmplx.h" -#include "oct-types.h" #include "syswait.h" extern OCTAVE_API octave_idx_type NINTbig (double x); diff --git a/liboctave/mx-op-decl.h b/liboctave/mx-op-decl.h --- 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&) diff --git a/liboctave/oct-inttypes.h b/liboctave/oct-inttypes.h --- 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 diff --git a/liboctave/oct-types.h.in b/liboctave/oct-types.h.in 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 -. - -*/ - -#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 -#elif defined (HAVE_INTTYPES_H) -#include -#else - -#if defined (HAVE_LIMITS_H) -#include -#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: *** -*/ diff --git a/liboctave/randgamma.h b/liboctave/randgamma.h --- a/liboctave/randgamma.h +++ b/liboctave/randgamma.h @@ -25,8 +25,6 @@ #ifndef _RANDGAMMA_H -#include "oct-types.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/liboctave/randmtzig.h b/liboctave/randmtzig.h --- 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 diff --git a/liboctave/randpoisson.h b/liboctave/randpoisson.h --- a/liboctave/randpoisson.h +++ b/liboctave/randpoisson.h @@ -25,8 +25,6 @@ #ifndef _RANDPOISSON_H -#include "oct-types.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/src/gripes.h b/src/gripes.h --- a/src/gripes.h +++ b/src/gripes.h @@ -26,8 +26,6 @@ #include -#include "oct-types.h" - class octave_value; extern OCTINTERP_API void