From da003742d9fbc051024e89241d5796e6403aded9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 2 Oct 2000 00:55:02 +0000 Subject: [PATCH] small patch from Dekel, begin introducing the real boost framework, get rid of the parts of boost that were located in support (block and utility) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1063 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 70 +++++ Makefile.am | 2 +- boost/.cvsignore | 1 + boost/Makefile.am | 3 + boost/boost/array.hpp | 159 +++++++++++ boost/boost/config.hpp | 346 +++++++++++++++++++++++ {src/support => boost/boost}/utility.hpp | 57 +++- boost/libs/README | 1 + config/lyxinclude.m4 | 4 +- configure.in | 1 + src/BufferView.h | 2 +- src/LColor.h | 2 +- src/LaTeX.h | 2 +- src/LyXAction.h | 2 +- src/LyXView.h | 2 +- src/Makefile.am | 3 +- src/bufferlist.h | 2 +- src/bufferparams.h | 6 +- src/frontends/ButtonPolicies.h | 2 +- src/frontends/Dialogs.h | 2 +- src/frontends/Makefile.am | 3 +- src/frontends/gnome/Makefile.am | 3 +- src/frontends/kde/Makefile.am | 3 +- src/frontends/xforms/FormBase.h | 2 +- src/frontends/xforms/FormGraphics.h | 2 +- src/frontends/xforms/FormParagraph.h | 2 +- src/frontends/xforms/FormTabular.h | 2 +- src/frontends/xforms/Makefile.am | 3 +- src/graphics/GraphicsCache.h | 2 +- src/graphics/Makefile.am | 3 +- src/graphics/Renderer.h | 2 +- src/insets/ExternalTemplate.h | 2 +- src/insets/Makefile.am | 3 +- src/insets/insetcommand.h | 2 +- src/lastfiles.h | 2 +- src/layout.h | 2 +- src/lyx_gui.h | 2 +- src/lyx_main.h | 2 +- src/lyxlex.h | 2 +- src/lyxparagraph.h | 4 +- src/lyxrc.h | 2 +- src/mathed/Makefile.am | 3 +- src/mathed/formula.C | 1 + src/mathed/formulamacro.C | 1 + src/support/Makefile.am | 7 +- src/support/block.h | 72 ----- src/support/lstrings.C | 2 +- src/support/path.h | 2 +- 48 files changed, 681 insertions(+), 126 deletions(-) create mode 100644 boost/.cvsignore create mode 100644 boost/Makefile.am create mode 100644 boost/boost/array.hpp create mode 100644 boost/boost/config.hpp rename {src/support => boost/boost}/utility.hpp (56%) create mode 100644 boost/libs/README delete mode 100644 src/support/block.h diff --git a/ChangeLog b/ChangeLog index c1a0f1100c..b2bb384ba9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,73 @@ +2000-10-02 Lars Gullik Bjønnes + + * src/support/utility.hpp: removed file + * src/support/block.h: removed file + + * src/support/Makefile.am (libsupport_la_SOURCES): remove block.h + and utility.hpp + + * src/mathed/formula.C: add support/lyxlib.h + * src/mathed/formulamacro.C: ditto + + * src/bufferparams.h: use boost/array.hpp instead of support/block.h + * src/lyxparagraph.h: ditto + + * src/Makefile.am (BOOST_INCLUDES): the boost include dir + * src/frontends/Makefile.am (INCLUDES): ditto + * src/frontends/gnome/Makefile.am (BOOST_INCLUDES): ditto + * src/frontends/kde/Makefile.am (BOOST_INCLUDES): ditto + * src/frontends/xforms/Makefile.am (BOOST_INCLUDES): ditto + * src/graphics/Makefile.am (BOOST_INCLUDES): ditto + * src/insets/Makefile.am (BOOST_INCLUDES): ditto + * src/mathed/Makefile.am (BOOST_INCLUDES): ditto + + * src/BufferView.h: use boost/utility.hpp + * src/LColor.h: ditto + * src/LaTeX.h: ditto + * src/LyXAction.h: ditto + * src/LyXView.h: ditto + * src/bufferlist.h: ditto + * src/lastfiles.h: ditto + * src/layout.h: ditto + * src/lyx_gui.h: ditto + * src/lyx_main.h: ditto + * src/lyxlex.h: ditto + * src/lyxrc.h: ditto + * src/frontends/ButtonPolicies.h: ditto + * src/frontends/Dialogs.h: ditto + * src/frontends/xforms/FormBase.h: ditto + * src/frontends/xforms/FormGraphics.h: ditto + * src/frontends/xforms/FormParagraph.h: ditto + * src/frontends/xforms/FormTabular.h: ditto + * src/graphics/GraphicsCache.h: ditto + * src/graphics/Renderer.h: ditto + * src/insets/ExternalTemplate.h: ditto + * src/insets/insetcommand.h: ditto + * src/support/path.h: ditto + + * config/lyxinclude.m4 (LYX_PROG_CXX): change clause for 2.96 + and introduce clause for 2.97. + + * boost/libs/README: new file + + * boost/boost/utility.hpp: new file + + * boost/boost/config.hpp: new file + + * boost/boost/array.hpp: new file + + * boost/Makefile.am: new file + + * boost/.cvsignore: new file + + * configure.in (AC_OUTPUT): add boost/Makefile + + * Makefile.am (SUBDIRS): add boost + +2000-10-01 Dekel Tsur + + * src/support/lstrings.C (suffixIs): Fixed. + 2000-10-01 Allan Rae * src/PrinterParams.h: moved things around to avoid the "can't diff --git a/Makefile.am b/Makefile.am index 9a52256508..a8269cf261 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ DISTCLEANFILES= *.orig *.rej *~ *.bak lyx.1 core MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/aclocal.m4 \ $(srcdir)/configure $(srcdir)/development/lyx.spec \ $(srcdir)/acinclude.m4 -SUBDIRS = intl po sigc++ src lib +SUBDIRS = intl po sigc++ boost src lib EXTRA_DIST = ANNOUNCE OLD-CHANGES INSTALL.OS2 INSTALL.autoconf README.OS2 \ UPGRADING lyx.man acconfig.h \ diff --git a/boost/.cvsignore b/boost/.cvsignore new file mode 100644 index 0000000000..70845e08eb --- /dev/null +++ b/boost/.cvsignore @@ -0,0 +1 @@ +Makefile.in diff --git a/boost/Makefile.am b/boost/Makefile.am new file mode 100644 index 0000000000..2663749eae --- /dev/null +++ b/boost/Makefile.am @@ -0,0 +1,3 @@ +DISTCLEANFILES= *.orig *.rej *~ *.bak core +MAINTAINERCLEANFILES= $(srcdir)/Makefile.in +ETAGS_ARGS = --lang=c++ diff --git a/boost/boost/array.hpp b/boost/boost/array.hpp new file mode 100644 index 0000000000..0b16c39643 --- /dev/null +++ b/boost/boost/array.hpp @@ -0,0 +1,159 @@ +/* The following code declares class array, + * an STL container (as wrapper) for arrays of constant size. + * + * See + * http://www.josuttis.com/cppcode + * for details and the latest version. + * + * (C) Copyright Nicolai M. Josuttis 1999. + * Permission to copy, use, modify, sell and distribute this software + * is granted provided this copyright notice appears in all copies. + * This software is provided "as is" without express or implied + * warranty, and with no claim as to its suitability for any purpose. + * + * Jul 31, 2000 + */ +#ifndef BOOST_ARRAY_HPP +#define BOOST_ARRAY_HPP + +#include +#include +#include +#include + +// BUG-FIX for compilers that don't support +// std::size_t and std::ptrdiff_t yet +// (such as gcc) +#include + +// LGB +// namespace boost { + + template + class array { + public: + T elems[N]; // fixed-size array of elements of type T + + public: + // type definitions + typedef T value_type; + typedef T* iterator; + typedef const T* const_iterator; + typedef T& reference; + typedef const T& const_reference; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + + // iterator support + iterator begin() { return elems; } + const_iterator begin() const { return elems; } + iterator end() { return elems+N; } + const_iterator end() const { return elems+N; } + + // reverse iterator support +# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; +# else + // workaround for broken reverse_iterator implementations due to no partial specialization + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; +# endif + + reverse_iterator rbegin() { return reverse_iterator(end()); } + const_reverse_iterator rbegin() const { + return const_reverse_iterator(end()); + } + reverse_iterator rend() { return reverse_iterator(begin()); } + const_reverse_iterator rend() const { + return const_reverse_iterator(begin()); + } + + // operator[] + reference operator[](size_type i) { return elems[i]; } + const_reference operator[](size_type i) const { return elems[i]; } + + // at() with range check + reference at(size_type i) { rangecheck(i); return elems[i]; } + const_reference at(size_type i) const { rangecheck(i); return elems[i]; } + + // front() and back() + reference front() { return elems[0]; } + const_reference front() const { return elems[0]; } + reference back() { return elems[N-1]; } + const_reference back() const { return elems[N-1]; } + + // size is constant + static size_type size() { return N; } + static bool empty() { return false; } + static size_type max_size() { return N; } + enum { static_size = N }; + + public: + // swap (note: linear complexity) + void swap (array& y) { + std::swap_ranges(begin(),end(),y.begin()); + } + + // direct access to data + const T* data() const { return elems; } + + // assignment with type conversion + template + array& operator= (const array& rhs) { + std::copy(rhs.begin(),rhs.end(), begin()); + return *this; + } + + // assign one value to all elements + void assign (const T& value) + { + std::fill_n(begin(),size(),value); + } + +# ifndef BOOST_NO_PRIVATE_IN_AGGREGATE + private: +# endif + // private member functions are allowed in aggregates [ISO 8.5.1] + static void rangecheck (size_type i) { + if (i >= size()) { throw std::range_error("array"); } + } + + }; + + // comparisons + template + bool operator== (const array& x, const array& y) { + return std::equal(x.begin(), x.end(), y.begin()); + } + template + bool operator< (const array& x, const array& y) { + return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end()); + } + template + bool operator!= (const array& x, const array& y) { + return !(x==y); + } + template + bool operator> (const array& x, const array& y) { + return y + bool operator<= (const array& x, const array& y) { + return !(y + bool operator>= (const array& x, const array& y) { + return !(x + inline void swap (array& x, array& y) { + x.swap(y); + } + +// LGB +// } /* namespace boost */ + +#endif /*BOOST_ARRAY_HPP*/ diff --git a/boost/boost/config.hpp b/boost/boost/config.hpp new file mode 100644 index 0000000000..59fc15e884 --- /dev/null +++ b/boost/boost/config.hpp @@ -0,0 +1,346 @@ +// Boost config.hpp configuration header file ------------------------------// + +// (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// See http://www.boost.org for most recent version. + +// Boost config.hpp policy and rationale documentation has been moved to +// http://www.boost.org/libs/config + +// Revision History (excluding minor changes for specific compilers) +// 25 Sep 00 BOOST_NO_STD_ALLOCATOR (Jeremy Siek) +// 18 SEP 00 BOOST_NO_SLIST, BOOST_NO_HASH, +// BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS +// BOOST_NO_LIMITS (Jeremy Siek) +// 1 Sep 00 BOOST_NO_PRIVATE_IN_AGGREGATE added. (Mark Rodgers) +// 23 Jul 00 Fixed spelling of BOOST_NO_INCLASS_MEMBER_INITIALIZATION in +// comment (Dave Abrahams). +// 10 Jul 00 BOOST_NO_POINTER_TO_MEMBER_CONST added (Mark Rodgers) +// 26 Jun 00 BOOST_NO_STD_ITERATOR, BOOST_MSVC_STD_ITERATOR, +// BOOST_NO_STD_ITERATOR_TRAITS, BOOST_NO_USING_TEMPLATE, +// added (Jeremy Siek) +// 20 Jun 00 BOOST_MSVC added (Aleksey Gurtovoy) +// 14 Jun 00 BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS (Jens M.) +// 22 Mar 00 BOOST_MSVC6_MEMBER_TEMPLATES added (Dave Abrahams) +// 18 Feb 00 BOOST_NO_INCLASS_MEMBER_INITIALIZATION added (Jens Maurer) +// 26 Jan 00 Borland compiler support added (John Maddock) +// 26 Jan 00 Sun compiler support added (Jörg Schaible) +// 30 Dec 99 BOOST_NMEMBER_TEMPLATES compatibility moved here from +// smart_ptr.hpp. (Dave Abrahams) +// 15 Nov 99 BOOST_NO_OPERATORS_IN_NAMESPACE, +// BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION added (Beman Dawes) +// 11 Oct 99 BOOST_NO_STDC_NAMESPACE refined; supplied +// 29 Sep 99 BOOST_NO_STDC_NAMESPACE added (Ed Brey) +// 24 Sep 99 BOOST_DECL added (Ed Brey) +// 10 Aug 99 Endedness flags added, GNU CC support added +// 22 Jul 99 Initial version + + +#ifndef BOOST_CONFIG_HPP +#define BOOST_CONFIG_HPP + +// Conformance Flag Macros -------------------------------------------------// +// +// Conformance flag macros should identify the absence of C++ Standard +// conformance rather than its presence. This ensures that standard conforming +// compilers do not require a lot of configuration flag macros. It places the +// burden where it should be, on non-conforming compilers. In the future, +// hopefully, less rather than more conformance flags will have to be defined. + +// BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS: Template value +// parameters cannot have a dependent type, for example +// "template class X { ... };" + +// BOOST_NO_INCLASS_MEMBER_INITIALIZATION: Compiler violates std::9.4.2/4. + +// BOOST_NO_MEMBER_TEMPLATES: Member template functions not fully supported. +// Also see BOOST_MSVC6_MEMBER_TEMPLATES in the Compiler Control section below. + +// BOOST_NO_MEMBER_TEMPLATE_FRIENDS: Member template friend syntax +// ("template friend class frd;") described in the C++ Standard, +// 14.5.3, not supported. + +// BOOST_NO_OPERATORS_IN_NAMESPACE: Compiler requires inherited operator +// friend functions to be defined at namespace scope, then using'ed to boost. +// Probably GCC specific. See boost/operators.hpp for example. + +// BOOST_NO_POINTER_TO_MEMBER_CONST: The compiler does not correctly handle +// pointers to const member functions, preventing use of these in overloaded +// function templates. See boost/functional.hpp for example. + +// BOOST_NO_PRIVATE_IN_AGGREGATE: The compiler misreads 8.5.1, treating classes +// as non-aggregate if they contain private or protected member functions. + +// BOOST_NO_STD_ITERATOR: The C++ implementation fails to provide the +// std::iterator class. + +// BOOST_NO_STD_ITERATOR_TRAITS: The compiler does not provide a standard +// compliant implementation of std::iterator_traits. Note that +// the compiler may still have a non-standard implementation. + +// BOOST_NO_STDC_NAMESPACE: The contents of C++ standard headers for C library +// functions (the headers) have not been placed in namespace std. +// Because the use of std::size_t is so common, a specific workaround for +// (and thus std::size_t) is provided in this header (see below). +// For other headers, a workaround must be provided in the boost header: +// +// #include // for abs +// #ifdef BOOST_NO_STDC_NAMESPACE +// namespace std { using ::abs; } +// #endif + +// BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION. Class template partial +// specialization (14.5.4 [temp.class.spec]) not supported. + +// BOOST_NO_USING_TEMPLATE: The compiler will not accept a using declaration +// that imports a template from the global namespace into a named namespace. +// Probably Borland specific. + +// Compiler Control or Information Macros ----------------------------------// +// +// Compilers often supply features outside of the C++ Standard which need to be +// controlled or detected. As usual, reasonable default behavior should occur +// if any of these macros are not defined. + +// BOOST_DECL: Certain compilers for Microsoft operating systems require +// non-standard class and function decoration if dynamic load library linking +// is desired. BOOST_DECL supplies that decoration, defaulting to a nul string +// so that it is harmless when not required. Boost does not encourage the use +// of BOOST_DECL - it is non-standard and to be avoided if practical to do so. + +// BOOST_DECL_EXPORTS: User defined, BOOST_DECL_EXPORTS causes BOOST_DECL to +// be defined as __declspec(dllexport) rather than __declspec(dllimport). + +// BOOST_MSVC6_MEMBER_TEMPLATES: Microsoft Visual C++ 6.0 has enough member +// template idiosyncrasies (being polite) that BOOST_NO_MEMBER_TEMPLATES is +// defined for this compiler. BOOST_MSVC6_MEMBER_TEMPLATES is defined to allow +// compiler specific workarounds. + +// BOOST_MSVC: defined as _MSC_VER for the Microsoft compiler only. In general, +// boost headers should test for a specific conformance flag macro (for +// example, BOOST_NO_MEMBER_TEMPLATE_FRIENDS) rather than a specific compiler. +// VC++ is a special case, however, since many libraries try to support it yet +// it has so many conformance issues that sometimes it is just easier to test +// for it directly. On the other hand, the obvious way to do this doesn't work, +// as many non-Microsoft compilers define _MSC_VER. Thus BOOST_MSVC. + +// BOOST_MSVC_STD_ITERATOR: Microsoft's broken version of std::iterator +// is being used. + +// BOOST_SYSTEM_HAS_STDINT_H: There are no 1998 C++ Standard headers +// or , although the 1999 C Standard does include . +// If is present, can make good use of it, +// so a flag is supplied (signalling presence; thus the default is not +// present, conforming to the current C++ standard). + +// BOOST_NO_SLIST: The C++ implementation does not provide the slist class. + +// BOOST_NO_HASH: The C++ implementation does not provide the hash_set +// or hash_map classes. + +// BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS: The standard library does not provide +// templated iterator constructors for its containers. + +// BOOST_NO_LIMITS: The C++ implementation does not provide the header. + +// BOOST_NO_INTRINSIC_WCHAR_T: The C++ implementation does not provide wchar_t, +// or it is really a synonym for another integral type. Use this symbol to +// decide whether it is appropriate to explicitly specialize a template on +// wchar_t if there is already a specialization for other integer types. + +// BOOST_NO_STD_ALLOCATOR: The C++ standard library does not provide +// a standards conforming std::allocator. + +// Compilers are listed in alphabetic order (except VC++ last - see below)---// + +// GNU CC (also known as GCC and G++) --------------------------------------// + +# if defined __GNUC__ +# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95 +# include // not sure this is the right way to do this -JGS +# if !defined(_CXXRT_STD) && !defined(__SGI_STL) // need to ask Dietmar about this -JGS +# define BOOST_NO_STD_ITERATOR +# define BOOST_NO_LIMITS +# endif +# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS +# define BOOST_NO_OPERATORS_IN_NAMESPACE +# endif +# if __GNUC__ == 2 && __GNUC_MINOR__ <= 8 +# define BOOST_NO_MEMBER_TEMPLATES +# endif + +// Kai C++ ------------------------------------------------------------------// + +#elif defined __KCC +# define BOOST_NO_SLIST +# define BOOST_NO_HASH + +// Greenhills C++ -----------------------------------------------------------// + +#elif defined __ghs +# define BOOST_NO_SLIST +# define BOOST_NO_HASH + +// Borland ------------------------------------------------------------------// + +#elif defined __BORLANDC__ +# if __BORLANDC__ <= 0x0551 +# define BOOST_NO_PRIVATE_IN_AGGREGATE +# endif +# if __BORLANDC__ <= 0x0550 +// Borland C++ Builder 4 and 5: +# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS +# define BOOST_NO_USING_TEMPLATE +# if __BORLANDC__ == 0x0550 +// Borland C++ Builder 5, command-line compiler 5.5: +# define BOOST_NO_OPERATORS_IN_NAMESPACE +# endif +# endif +# if defined BOOST_DECL_EXPORTS +# define BOOST_DECL __declspec(dllexport) +# else +# define BOOST_DECL __declspec(dllimport) +# endif + +// Intel -------------------------------------------------------------------// + +# elif defined __ICL +# include // not sure this is the right way to do this -JGS +# if __SGI_STL_PORT >= 0x400 || __SGI_STL_PORT >= 0x321 && defined(__STL_USE_NAMESPACES) + // a perfectly good implementation of std::iterator is supplied +# elif defined(__SGI_STL_ITERATOR) +# define BOOST_NO_STD_ITERATOR // No std::iterator in this case +# else // assume using dinkumware's STL that comes with VC++ 6.0 +# define BOOST_MSVC_STD_ITERATOR +# define BOOST_NO_STD_ITERATOR_TRAITS +# define BOOST_NO_STDC_NAMESPACE +# define BOOST_NO_SLIST +# define BOOST_NO_HASH +# define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS +# define BOOST_NO_STD_ALLOCATOR +# endif + + +// Metrowerks CodeWarrior --------------------------------------------------// + +# elif defined __MWERKS__ +# if __MWERKS__ <= 0x4000 +# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS +# endif +# if __MWERKS__ <= 0x2301 +# define BOOST_NO_POINTER_TO_MEMBER_CONST +# endif +# if __MWERKS__ >= 0x2300 +# define BOOST_SYSTEM_HAS_STDINT_H +# endif +# if defined BOOST_DECL_EXPORTS +# define BOOST_DECL __declspec(dllexport) +# else +# define BOOST_DECL __declspec(dllimport) +# endif + +// Sun Workshop Compiler C++ ------------------------------------------------// + +# elif defined __SUNPRO_CC +# if __SUNPRO_CC <= 0x500 +# define BOOST_NO_MEMBER_TEMPLATES +# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# endif + +// Microsoft Visual C++ (excluding Intel/EDG front end) --------------------// +// +// Must remain the last #elif since some other vendors (Metrowerks, for +// example) also #define _MSC_VER + +# elif defined _MSC_VER +# define BOOST_MSVC _MSC_VER + + // turn off the warnings before we #include anything +# pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info +# pragma warning( disable : 4503 ) // warning: decorated name length exceeded + +# if _MSC_VER <= 1200 // 1200 == VC++ 6.0 +# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION +# define BOOST_NO_PRIVATE_IN_AGGREGATE + +# define BOOST_NO_INTRINSIC_WCHAR_T + +// VC++ 6.0 has member templates but they have numerous problems including +// cases of silent failure, so for safety we define: +# define BOOST_NO_MEMBER_TEMPLATES +// For VC++ experts wishing to attempt workarounds, we define: +# define BOOST_MSVC6_MEMBER_TEMPLATES + +# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS +# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS + +# include // not sure this is the right way to do this -JGS +# if __SGI_STL_PORT >= 0x400 || __SGI_STL_PORT >= 0x321 && defined(__STL_USE_NAMESPACES) + // a perfectly good implementation of std::iterator is supplied +# elif defined(__SGI_STL_ITERATOR) +# define BOOST_NO_STD_ITERATOR // No std::iterator in this case +# else +# define BOOST_MSVC_STD_ITERATOR 1 +# define BOOST_NO_SLIST +# define BOOST_NO_HASH +# define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS +# define BOOST_NO_STD_ALLOCATOR +# endif +# define BOOST_NO_STD_ITERATOR_TRAITS + + +// Make sure at least one standard library header is included so that library +// implementation detection will work, even if no standard headers have been +// included in front of a boost header. (Ed Brey 5 Jun 00) +# include + +// Determine if the standard library implementation is already pulling names +// into std. STLport defines the following if so. (Ed Brey 5 Jun 00) +# ifndef __STL_IMPORT_VENDOR_CSTD +# define BOOST_NO_STDC_NAMESPACE +# endif + +# endif + +# if defined BOOST_DECL_EXPORTS +# define BOOST_DECL __declspec(dllexport) +# else +# define BOOST_DECL __declspec(dllimport) +# endif + +# endif // Microsoft (excluding Intel/EDG frontend) + +# ifndef BOOST_DECL +# define BOOST_DECL // default for compilers not needing this decoration. +# endif + +// end of compiler specific portion ----------------------------------------// + +// Check for old name "BOOST_NMEMBER_TEMPLATES" for compatibility -----------// +// Don't use BOOST_NMEMBER_TEMPLATES. It is deprecated and will be removed soon. +#if defined( BOOST_NMEMBER_TEMPLATES ) && !defined( BOOST_NO_MEMBER_TEMPLATES ) + #define BOOST_NO_MEMBER_TEMPLATES +#endif + +// BOOST_NO_STDC_NAMESPACE workaround --------------------------------------// +// +// Because std::size_t usage is so common, even in boost headers which do not +// otherwise use the C library, the workaround is included here so +// that ugly workaround code need not appear in many other boost headers. +// NOTE WELL: This is a workaround for non-conforming compilers; +// must still be #included in the usual places so that inclusion +// works as expected with standard conforming compilers. The resulting +// double inclusion of is harmless. + +# ifdef BOOST_NO_STDC_NAMESPACE +# include + namespace std { using ::ptrdiff_t; using ::size_t; } + // using ::wchar_t; removed since wchar_t is a C++ built-in type (Ed Brey) +# endif + + +#endif // BOOST_CONFIG_HPP diff --git a/src/support/utility.hpp b/boost/boost/utility.hpp similarity index 56% rename from src/support/utility.hpp rename to boost/boost/utility.hpp index 4ee99278b5..7d3503aa82 100644 --- a/src/support/utility.hpp +++ b/boost/boost/utility.hpp @@ -1,4 +1,4 @@ -// boost utility.hpp header file ----------------------------------------// +// boost utility.hpp header file -------------------------------------------// // (C) Copyright boost.org 1999. Permission to copy, use, modify, sell // and distribute this software is granted provided this copyright @@ -11,19 +11,22 @@ // Classes appear in alphabetical order // Revision History -// 10 Dec 99 next() and prior() templates added. -// 30 Aug 99 moved cast templates to cast.hpp +// 26 Jan 00 protected noncopyable destructor added (Miki Jovanovic) +// 10 Dec 99 next() and prior() templates added (Dave Abrahams) +// 30 Aug 99 moved cast templates to cast.hpp (Beman Dawes) // 3 Aug 99 cast templates added // 20 Jul 99 name changed to utility.hpp // 9 Jun 99 protected noncopyable default ctor -// 2 Jun 99 Initial Version. Class noncopyable only contents. +// 2 Jun 99 Initial Version. Class noncopyable only contents (Dave Abrahams) #ifndef BOOST_UTILITY_HPP #define BOOST_UTILITY_HPP -//#include -//#include // for size_t +#include +#include // for size_t +#include // for std::pair +// LGB //namespace boost //{ @@ -52,15 +55,47 @@ // Contributed by Dave Abrahams -class noncopyable -{ -protected: + class noncopyable + { + protected: noncopyable(){} -private: // emphasize the following members are private + ~noncopyable(){} + private: // emphasize the following members are private noncopyable( const noncopyable& ); const noncopyable& operator=( const noncopyable& ); -}; // noncopyable + }; // noncopyable +// class tied -------------------------------------------------------// + + // A helper for conveniently assigning the two values from a pair + // into separate variables. The idea for this comes from Jaakko J„rvi's + // Binder/Lambda Library. + + // Constributed by Jeremy Siek + + template + class tied { + public: + inline tied(A& a, B& b) : _a(a), _b(b) { } + template + inline tied& operator=(const std::pair& p) { + _a = p.first; + _b = p.second; + return *this; + } + protected: + A& _a; + B& _b; + }; + + template + inline tied tie(A& a, B& b) { return tied(a, b); } + +// LGB //} // namespace boost #endif // BOOST_UTILITY_HPP + + + + diff --git a/boost/libs/README b/boost/libs/README new file mode 100644 index 0000000000..8ec6c04c17 --- /dev/null +++ b/boost/libs/README @@ -0,0 +1 @@ +This is just a placeholder. We will put boost cpp files here when we need them. diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 9053a8d051..152bbbe05e 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -186,7 +186,8 @@ dnl Check the version of g++ case $gxx_version in 2.95.1) CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti -fno-exceptions";; 2.95.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; - 2.96*) CXXFLAGS="-g $lyx_opt -fhonor-std -fvtable-thunks -ffunction-sections -fdata-sections";; + 2.96*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; + 2.97*) CXXFLAGS="-g $lyx_opt -fhonor-std -fvtable-thunks -ffunction-sections -fdata-sections";; *2.91.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; *) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";; esac @@ -197,6 +198,7 @@ dnl Check the version of g++ case $gxx_version in 2.95.*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion -Winline";; 2.96*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion -Winline";; + 2.97*) CXXFLAGS="$CXXFLAGS -W -Wall -Wconversion -Winline";; *) CXXFLAGS="$CXXFLAGS -W -Wall -Wno-return-type";; esac if test $lyx_devel_version = yes ; then diff --git a/configure.in b/configure.in index e8aecb2a15..d3a9592a36 100644 --- a/configure.in +++ b/configure.in @@ -283,6 +283,7 @@ AC_OUTPUT([Makefile \ lib/Makefile \ intl/Makefile \ po/Makefile.in \ + boost/Makefile \ src/Makefile \ src/mathed/Makefile \ src/graphics/Makefile \ diff --git a/src/BufferView.h b/src/BufferView.h index 00cfc04917..e13893664a 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -18,7 +18,7 @@ #include FORMS_H_LOCATION #include "undo.h" -#include "support/utility.hpp" +#include class LyXView; class LyXText; diff --git a/src/LColor.h b/src/LColor.h index 6f8af995b5..eae06f5500 100644 --- a/src/LColor.h +++ b/src/LColor.h @@ -18,7 +18,7 @@ #include #include "LString.h" -#include "support/utility.hpp" +#include /** This is a stateless class. diff --git a/src/LaTeX.h b/src/LaTeX.h index b57a57e6ab..fcd013b8dd 100644 --- a/src/LaTeX.h +++ b/src/LaTeX.h @@ -23,7 +23,7 @@ #include "DepTable.h" #include -#include "support/utility.hpp" +#include class MiniBuffer; diff --git a/src/LyXAction.h b/src/LyXAction.h index cf611e3c35..3ec318a596 100644 --- a/src/LyXAction.h +++ b/src/LyXAction.h @@ -10,7 +10,7 @@ #include "commandtags.h" #include "LString.h" -#include "support/utility.hpp" +#include /** This class encapsulates LyX action and user command operations. */ diff --git a/src/LyXView.h b/src/LyXView.h index 9072a3ccf0..87ad3703e1 100644 --- a/src/LyXView.h +++ b/src/LyXView.h @@ -20,7 +20,7 @@ #include "LString.h" #include "Timeout.h" -#include "support/utility.hpp" +#include #include "layout.h" class LyXFunc; diff --git a/src/Makefile.am b/src/Makefile.am index 7bc192a80a..49537854e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,7 +16,8 @@ lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) $(SIGC_LIBS) \ #lyx_LDFLAGS=-Wl,-O1 EXTRA_DIST = config.h.in stamp-h.in cheaders ETAGS_ARGS = --lang=c++ -INCLUDES = $(SIGC_CFLAGS) $(PSPELL_INCLUDES) @FRONTEND_INCLUDES@ +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = $(SIGC_CFLAGS) $(BOOST_INCLUDES) $(PSPELL_INCLUDES) @FRONTEND_INCLUDES@ localedir = $(datadir)/locale lyx_SOURCES = \ BackStack.h \ diff --git a/src/bufferlist.h b/src/bufferlist.h index 7a89a8a87e..f186b84e0b 100644 --- a/src/bufferlist.h +++ b/src/bufferlist.h @@ -20,7 +20,7 @@ #include "buffer.h" #include "debug.h" -#include "support/utility.hpp" +#include /** A class to hold all the buffers in a structure The point of this class is to hide from bufferlist what kind diff --git a/src/bufferparams.h b/src/bufferparams.h index 70d147c242..ddff969787 100644 --- a/src/bufferparams.h +++ b/src/bufferparams.h @@ -23,7 +23,7 @@ #include "Bullet.h" #include "insets/insetquotes.h" #include "layout.h" -#include "support/block.h" +#include struct Language; @@ -192,9 +192,9 @@ public: /// string pagestyle; /// - block temp_bullets; + array temp_bullets; /// - block user_defined_bullets; + array user_defined_bullets; /// void readPreamble(LyXLex &); /// diff --git a/src/frontends/ButtonPolicies.h b/src/frontends/ButtonPolicies.h index 80661a662f..4c2c118e29 100644 --- a/src/frontends/ButtonPolicies.h +++ b/src/frontends/ButtonPolicies.h @@ -21,7 +21,7 @@ #include -#include "support/utility.hpp" +#include /** An abstract base class for button policies. diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index 03b988b8a7..296e552e10 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -22,7 +22,7 @@ #include #include "LString.h" -#include "support/utility.hpp" +#include class DialogBase; diff --git a/src/frontends/Makefile.am b/src/frontends/Makefile.am index 2f826473b1..abe51ff8e4 100644 --- a/src/frontends/Makefile.am +++ b/src/frontends/Makefile.am @@ -6,7 +6,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in # here. SUBDIRS = xforms @FRONTEND@ ETAGS_ARGS = --lang=c++ -INCLUDES = ${FRONTEND_INCLUDES} -I${srcdir}/.. -I${srcdir}/xforms ${SIGC_CFLAGS} +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = ${FRONTEND_INCLUDES} -I${srcdir}/.. -I${srcdir}/xforms ${SIGC_CFLAGS} $(BOOST_INCLUDES) LIBS = noinst_LTLIBRARIES = libfrontends.la libfrontends_la_SOURCES=\ diff --git a/src/frontends/gnome/Makefile.am b/src/frontends/gnome/Makefile.am index e40daf9740..7a0c1f634a 100644 --- a/src/frontends/gnome/Makefile.am +++ b/src/frontends/gnome/Makefile.am @@ -2,9 +2,10 @@ AUTOMAKE_OPTIONS = foreign 1.4 DISTCLEANFILES= *.orig *.rej *~ *.bak core MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libgnome.la +BOOST_INCLUDES = -I$(top_srcdir)/boost INCLUDES = ${FRONTEND_INCLUDES} -I${top_srcdir}/src/ \ -I${top_srcdir}/src/frontends/ -I${top_srcdir}/src/frontends/xforms \ - ${SIGC_CFLAGS} + ${SIGC_CFLAGS} $(BOOST_INCLUDES) libgnome_la_OBJADD = \ ../xforms/FormBase.lo \ ../xforms/FormCitation.lo \ diff --git a/src/frontends/kde/Makefile.am b/src/frontends/kde/Makefile.am index 3eb5671b3a..473d530912 100644 --- a/src/frontends/kde/Makefile.am +++ b/src/frontends/kde/Makefile.am @@ -1,8 +1,9 @@ AUTOMAKE_OPTIONS = foreign 1.4 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libkde.la +BOOST_INCLUDES = -I$(top_srcdir)/boost INCLUDES = -I${top_srcdir}/src/ -I${top_srcdir}/src/frontends/ \ - ${SIGC_CFLAGS} ${FRONTEND_INCLUDES} \ + ${SIGC_CFLAGS} ${FRONTEND_INCLUDES} $(BOOST_INCLUDES) \ -I${top_srcdir}/src/frontends/xforms # just to make sure, automake makes them diff --git a/src/frontends/xforms/FormBase.h b/src/frontends/xforms/FormBase.h index 2524d88723..09745ed28f 100644 --- a/src/frontends/xforms/FormBase.h +++ b/src/frontends/xforms/FormBase.h @@ -14,7 +14,7 @@ #include "DialogBase.h" #include "LString.h" -#include "support/utility.hpp" +#include #include FORMS_H_LOCATION #include "ButtonController.h" #include "gettext.h" diff --git a/src/frontends/xforms/FormGraphics.h b/src/frontends/xforms/FormGraphics.h index d554b25468..88abccabce 100644 --- a/src/frontends/xforms/FormGraphics.h +++ b/src/frontends/xforms/FormGraphics.h @@ -21,7 +21,7 @@ #include "LString.h" #include "frontends/DialogBase.h" #include "RadioButtonGroup.h" -#include "support/utility.hpp" +#include #ifdef __GNUG__ #pragma interface diff --git a/src/frontends/xforms/FormParagraph.h b/src/frontends/xforms/FormParagraph.h index ca2b970bc6..b34a1e23d4 100644 --- a/src/frontends/xforms/FormParagraph.h +++ b/src/frontends/xforms/FormParagraph.h @@ -14,7 +14,7 @@ #define FORM_PARAGRAPH_H #include "DialogBase.h" -#include "support/utility.hpp" +#include #include #ifdef __GNUG_ diff --git a/src/frontends/xforms/FormTabular.h b/src/frontends/xforms/FormTabular.h index f625b587af..aa95b0fae1 100644 --- a/src/frontends/xforms/FormTabular.h +++ b/src/frontends/xforms/FormTabular.h @@ -18,7 +18,7 @@ #define FORMTABULAR_H #include "DialogBase.h" -#include "support/utility.hpp" +#include #ifdef SIGC_CXX_NAMESPACES using SigC::Connection; diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index 9e0cb8efff..d8f0430dec 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -2,9 +2,10 @@ AUTOMAKE_OPTIONS = foreign 1.4 DISTCLEANFILES= *.orig *.rej *~ *.bak core MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libxforms.la +BOOST_INCLUDES = -I$(top_srcdir)/boost INCLUDES = -I${top_srcdir}/src/ \ -I${top_srcdir}/src/frontends/ \ - ${SIGC_CFLAGS} + ${SIGC_CFLAGS} $(BOOST_INCLUDES) LIBS= LDFLAGS= LYXDATADIRS = forms diff --git a/src/graphics/GraphicsCache.h b/src/graphics/GraphicsCache.h index e9a8c6f88c..b0c7e4f6e6 100644 --- a/src/graphics/GraphicsCache.h +++ b/src/graphics/GraphicsCache.h @@ -20,7 +20,7 @@ #include "LString.h" #include "GraphicsCacheItem.h" -#include "support/utility.hpp" +#include /** GraphicsCache is the manager of the image cache. It is responsible of create the GraphicsCacheItem's and maintain them. diff --git a/src/graphics/Makefile.am b/src/graphics/Makefile.am index 5b02f67af4..1224ae7256 100644 --- a/src/graphics/Makefile.am +++ b/src/graphics/Makefile.am @@ -4,7 +4,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libgraphics.la LIBS = ETAGS_ARGS = --lang=c++ -INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS) +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS) $(BOOST_INCLUDES) libgraphics_la_SOURCES = \ Renderer.h \ diff --git a/src/graphics/Renderer.h b/src/graphics/Renderer.h index a8b6044db8..4cf56d767a 100644 --- a/src/graphics/Renderer.h +++ b/src/graphics/Renderer.h @@ -20,7 +20,7 @@ #include "LString.h" #include "X11/Xlib.h" -#include "support/utility.hpp" +#include /** Renderer is a base class that is used to take an image format, and render it into a Pixmap in order to be able to display it later on diff --git a/src/insets/ExternalTemplate.h b/src/insets/ExternalTemplate.h index 63f85dbdec..d643f5d483 100644 --- a/src/insets/ExternalTemplate.h +++ b/src/insets/ExternalTemplate.h @@ -19,7 +19,7 @@ #include #include #include "LString.h" -#include "support/utility.hpp" +#include class LyXLex; diff --git a/src/insets/Makefile.am b/src/insets/Makefile.am index 9574baa198..a66dec59e5 100644 --- a/src/insets/Makefile.am +++ b/src/insets/Makefile.am @@ -4,7 +4,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libinsets.la LIBS = ETAGS_ARGS = --lang=c++ -INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS) +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS) $(BOOST_INCLUDES) libinsets_la_SOURCES = \ BoundingBox.h \ diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index 8575639032..2e75be5bbe 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -18,7 +18,7 @@ #include "insetbutton.h" #include -#include "support/utility.hpp" +#include #ifdef SIGC_CXX_NAMESPACES using SigC::Signal0; diff --git a/src/lastfiles.h b/src/lastfiles.h index dee8c5e0f8..a5816204ca 100644 --- a/src/lastfiles.h +++ b/src/lastfiles.h @@ -19,7 +19,7 @@ #include #include "LString.h" -#include "support/utility.hpp" +#include /** The latest documents loaded. This class takes care of the last .lyx files used by the LyX user. It diff --git a/src/layout.h b/src/layout.h index 789f9ca098..7359b2d4a0 100644 --- a/src/layout.h +++ b/src/layout.h @@ -21,7 +21,7 @@ #include "lyxlex.h" #include "lyxfont.h" #include "Spacing.h" -#include "support/utility.hpp" +#include /// Reads the style files extern void LyXSetStyle(); diff --git a/src/lyx_gui.h b/src/lyx_gui.h index 17dedf9edf..98fd4c19e1 100644 --- a/src/lyx_gui.h +++ b/src/lyx_gui.h @@ -12,7 +12,7 @@ #ifndef LYX_GUI_H #define LYX_GUI_H -#include "support/utility.hpp" +#include #ifdef __GNUG__ #pragma interface diff --git a/src/lyx_main.h b/src/lyx_main.h index 0ba6779ef7..ba5db6b409 100644 --- a/src/lyx_main.h +++ b/src/lyx_main.h @@ -22,7 +22,7 @@ #include #include "LString.h" -#include "support/utility.hpp" +#include class LyXGUI; class LyXRC; diff --git a/src/lyxlex.h b/src/lyxlex.h index 420396be13..f7113e9c9c 100644 --- a/src/lyxlex.h +++ b/src/lyxlex.h @@ -14,7 +14,7 @@ #include #include "LString.h" -#include "support/utility.hpp" +#include /// struct keyword_item { diff --git a/src/lyxparagraph.h b/src/lyxparagraph.h index 48476bd5ae..03b498e706 100644 --- a/src/lyxparagraph.h +++ b/src/lyxparagraph.h @@ -22,7 +22,7 @@ #include "insets/lyxinset.h" #include "vspace.h" #include "layout.h" -#include "support/block.h" +#include #include "language.h" class BufferParams; @@ -286,7 +286,7 @@ public: private: /// - block counter_; + array counter_; public: /// void setCounter(int i, int v) { counter_[i] = v; } diff --git a/src/lyxrc.h b/src/lyxrc.h index 5db59f3198..3281a0df86 100644 --- a/src/lyxrc.h +++ b/src/lyxrc.h @@ -17,7 +17,7 @@ #endif #include "bufferparams.h" -#include "support/utility.hpp" +#include /// This contains the runtime configuration of LyX class LyXRC : public noncopyable { diff --git a/src/mathed/Makefile.am b/src/mathed/Makefile.am index 78cfe28e45..2ed45838b7 100644 --- a/src/mathed/Makefile.am +++ b/src/mathed/Makefile.am @@ -4,7 +4,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libmathed.la LIBS= ETAGS_ARGS = --lang=c++ -INCLUDES = -I${top_srcdir}/images -I${srcdir}/../ $(SIGC_CFLAGS) +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = -I${top_srcdir}/images -I${srcdir}/../ $(SIGC_CFLAGS) $(BOOST_INCLUDES) libmathed_la_SOURCES = array.h \ formula.C \ diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 6d7f75a588..58230fa627 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -37,6 +37,7 @@ #include "LyXView.h" #include "Painter.h" #include "font.h" +#include "support/lyxlib.h" using std::ostream; using std::istream; diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index d74a5b3bff..10f9c5d238 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -30,6 +30,7 @@ #include "gettext.h" #include "Painter.h" #include "font.h" +#include "support/lyxlib.h" using std::ostream; using std::istream; diff --git a/src/support/Makefile.am b/src/support/Makefile.am index 6d5bcb61cb..4278b992b9 100644 --- a/src/support/Makefile.am +++ b/src/support/Makefile.am @@ -4,7 +4,8 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libsupport.la LIBS = ETAGS_ARGS = --lang=c++ -INCLUDES = -I${srcdir}/../ +BOOST_INCLUDES = -I$(top_srcdir)/boost +INCLUDES = -I${srcdir}/../ $(BOOST_INCLUDES) EXTRA_DIST = lyxstring.C lyxstring.h regex.c lyxregex.h @@ -32,7 +33,6 @@ libsupport_la_SOURCES = \ StrPool.h \ abort.C \ atoi.C \ - block.h \ chdir.C \ copy.C \ date.C \ @@ -62,5 +62,4 @@ libsupport_la_SOURCES = \ syssingleton.C \ translator.h \ textutils.h \ - unlink.C \ - utility.hpp + unlink.C diff --git a/src/support/block.h b/src/support/block.h deleted file mode 100644 index 87315c5adf..0000000000 --- a/src/support/block.h +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- - -#ifndef BLOCK_H -#define BLOCK_H - -#include "LAssert.h" - -/// -template -class block { -public: - /// - typedef T value_type; - /// - typedef size_t size_type; - /// - typedef T * pointer; - /// - typedef T const * const_pointer; - /// - typedef T & reference; - /// - typedef T const & const_reference; - /// - typedef T * iterator; - /// - typedef T const * const_iterator; - /// - size_type size() const { return s; } - /// - reference at(int i) { - Assert(i >= 0 && i < s); - return arr[i]; - } - /// - const_reference at(int i) const { - Assert(i >= 0 && i < s); - return arr[i]; - } - /// - reference operator[](int i) { return arr[i]; } - /// - const_reference operator[](int i) const { return arr[i]; } - /// - void operator=(block const & b) { - Assert(b.size() == size()); - for (size_t i = 0; i < size(); ++i) { - arr[i] == b[i]; - } - } - /// - bool operator==(block const & b) const { - Assert(b.size() == size()); - for (size_t i = 0; i < size(); ++i) { - if (arr[i] != b[i]) return false; - } - return true; - } - /// - iterator begin() { return arr[0]; } - /// - iterator end() { return arr[s]; } - /// - const_iterator begin() const { return arr[0]; } - /// - const_iterator end() const { return arr[s]; } -private: - /// - T arr[s]; -}; - -#endif // BLOCK_H_ diff --git a/src/support/lstrings.C b/src/support/lstrings.C index fae7df7bfa..87e67e45ea 100644 --- a/src/support/lstrings.C +++ b/src/support/lstrings.C @@ -283,7 +283,7 @@ bool suffixIs(string const & a, string const & suf) string tmp(a, alen - suflen); return ::strncmp(tmp.c_str(), suf.c_str(), suflen) == 0; #else - return a.compare(alen - suflen, suflen, suf); + return a.compare(alen - suflen, suflen, suf) == 0; #endif } } diff --git a/src/support/path.h b/src/support/path.h index 893b4bdc71..ced3358c24 100644 --- a/src/support/path.h +++ b/src/support/path.h @@ -5,7 +5,7 @@ #include "LString.h" #include "filetools.h" #include "lyxlib.h" -#include "utility.hpp" +#include #ifdef __GNUG__ #pragma interface