1999-12-13 Allan Rae <rae@lyx.org>
+ * src/mathed/math_hash.C (math_hash): renamed from hash(), name clash.
+ (in_word_set): hash() -> math_hash()
+
+ * src/LString.h: Used USING_EXCEPTIONS in SGI STL-3.2 support
+
+ * acconfig.h: Added a test for whether we are using exceptions in the
+ current compilation run. If so USING_EXCEPTIONS is defined.
+
+ * config.in: Check for existance of stl_string_fwd.h
+ * src/LString.h: If compiling --with-included-string and SGI's
+ STL version 3.2 is present (see above test) we need to block their
+ forward declaration of string and supply a __get_c_string().
+ However, it turns out this is only necessary if compiling with
+ exceptions enabled so I've a bit more to add yet.
+
+ * src/insets/figinset.[Ch], src/insets/insetinclude.C,
+ src/insets/insetloa.C, src/layout.h, src/lyxparagraph.h,
+ src/support/LRegex.h, src/undo.h:
+ Shuffle the order of the included files a little to ensure that
+ LString.h gets included before anything that includes stl_string_fwd.h
+
+ * src/support/lyxstring.C: We need to #include LString.h instead of
+ lyxstring.h to get the necessary definition of __get_c_string.
+ (__get_c_string): New function. This is defined static just like SGI's
+ although why they need to do this I'm not sure. Perhaps it should be
+ in lstrings.C instead.
+
* lib/templates/IEEEtran.lyx: New template file.
1999-12-12 Lars Gullik Bjønnes <larsbj@lyx.org>
/**/#undef const
#endif
+/* Check on the run if we are using exceptions during this compilation.*/
+#if defined(__sgi) || defined(__GNUC__)
+# ifdef __EXCEPTIONS
+# define USING_EXCEPTIONS
+# endif
+#endif
+
+#if defined(__USLC__) || defined(__SUNPRO_CC) || defined(__COMO__) || defined(__ICL)
+# define USING_EXCEPTIONS
+#endif
#ifdef __EMX__
#include "os2_defines.h"
# some standard header files
AC_HEADER_DIRENT
AC_HEADER_MAJOR
-AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h)
+AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h stl_string_fwd.h)
# some standard structures
AC_HEADER_STAT
#else
#include "support/lyxstring.h"
typedef lyxstring string;
+#if defined(USING_EXCEPTIONS) && defined(HAVE_STL_STRING_FWD_H)
+// Hide the forward declaration of string by SGI's STL > 3.13. But only when
+// exceptions are in use.
+// Due to a clash with SGI's forward declaration of string we have to provide
+// __get_c_string() ourselves since SGI expects it to exist and block
+// their string declarations as best we can. ARRae.
+# define __SGI_STL_STRING_FWD_H
+static const char* __get_c_string(const string&);
+#endif // HAVE_STL_STRING_FWD_H
#endif
#endif
#include <fstream>
using std::ofstream;
-#include "form1.h"
#include "figinset.h"
#include "lyx.h"
#include "lyx_main.h"
#define FIGINSET_H
#include "form1.h"
-#include "buffer.h"
#include "LString.h"
+#include "buffer.h"
#include "LaTeXFeatures.h"
#include "insets/lyxinset.h"
/* the rest is figure stuff */
#endif
#include FORMS_H_LOCATION
-#include "filedlg.h"
#include "insetinclude.h"
+#include "filedlg.h"
#include "buffer.h"
#include "bufferlist.h"
#include "debug.h"
#pragma implementation "insetlot.h"
#endif
-#include "LaTeXFeatures.h"
#include "insetloa.h"
#include "insetlof.h"
#include "insetlot.h"
+#include "LaTeXFeatures.h"
void InsetLOA::Validate(LaTeXFeatures & features) const
{
#pragma interface
#endif
-#include <vector>
-using std::vector;
-using std::pair;
-
#include "lyxlex.h"
#include "lyxfont.h"
#include "Spacing.h"
+#include <vector>
+using std::vector;
+using std::pair;
+
/// Reads the style files
extern void LyXSetStyle();
#pragma interface
#endif
+#include "insets/lyxinset.h"
+#include "insets/insetbib.h"
+#include "table.h"
+#include "vspace.h"
+#include "layout.h"
+#include "support/block.h"
+
//#define NEW_TABLE 1
#ifdef NEW_TABLE
#include <vector>
-#include "insets/lyxinset.h"
-#include "insets/insetbib.h"
-#include "table.h"
-#include "vspace.h"
-#include "layout.h"
-#include "support/block.h"
-
class BufferParams;
class LyXBuffer;
class TexRow;
/* maximum key range = 483, duplicates = 40 */
static unsigned int
-hash (register char const *str, register int len)
+math_hash (register char const *str, register int len)
{
static unsigned short asso_values[] =
{
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
- register int key = hash (str, len);
+ register int key = math_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
#pragma interface
#endif
+#include "LString.h"
+
#include <vector>
using std::vector;
using std::pair;
-#include "LString.h"
-
///
class LRegex {
public:
#pragma implementation "lyxstring.h"
#endif
-#include "lyxstring.h"
+#include "LString.h"
#include <cstdlib>
#include <cctype>
#include <algorithm>
}
+#ifdef HAVE_STL_STRING_FWD_H
+// SGI's STL > 3.13 expects string to provide __get_c_string.
+// Due to a clash with SGI's forward declaration of string we have
+// to provide this ourselves and block their string declarations
+// as best we can. ARRae.
+
+static const char* __get_c_string(const string & s)
+{
+ return s.c_str();
+}
+#endif
+
+
////////////////////
// Comparisons
////////////////////
#pragma interface
#endif
-#include <list>
-using std::list;
-
#include "lyxparagraph.h"
+#include <list>
+using std::list;
///
class Undo {