]> git.lyx.org Git - features.git/commitdiff
included sgi-stl-32-merge
authorAllan Rae <rae@lyx.org>
Mon, 13 Dec 1999 07:33:00 +0000 (07:33 +0000)
committerAllan Rae <rae@lyx.org>
Mon, 13 Dec 1999 07:33:00 +0000 (07:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@373 a592a061-630c-0410-9148-cb99ea01b6c8

14 files changed:
ChangeLog
acconfig.h
configure.in
src/LString.h
src/insets/figinset.C
src/insets/figinset.h
src/insets/insetinclude.C
src/insets/insetloa.C
src/layout.h
src/lyxparagraph.h
src/mathed/math_hash.C
src/support/LRegex.h
src/support/lyxstring.C
src/undo.h

index 46bc603994ae72675460602fd338e603a6836003..803919880800999367e561d1ecd6df92a5df85e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,32 @@
 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>
index a897db211fafe30bf2166f390badf5a162ba61f6..3e53433af64e44356bb6798ecaecf41851dd62c8 100644 (file)
@@ -144,6 +144,16 @@ char * strerror(int n);
 /**/#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"
index 1d9c8c851ad45a6b8a8732cbbe9401e9e58de7b7..ee1b2ef808cec636ca05b32c190e40ec45e89401 100644 (file)
@@ -161,7 +161,7 @@ AC_LANG_CPLUSPLUS
 # 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
index eabdc7e815caa6a3035866c296ce8ce2852803af..bdb5512c0165697dab580c4e564c7cfcf4dce8d5 100644 (file)
@@ -18,5 +18,14 @@ using std::string;
 #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
index 6eadca591aad55af3769ddaaef0e7831cfd4bdbe..aa2a7f51d97d35060681c4bb025dfb36298fc489 100644 (file)
@@ -42,7 +42,6 @@ extern long int background_pixels;
 #include <fstream>
 using std::ofstream;
 
-#include "form1.h"
 #include "figinset.h"
 #include "lyx.h"
 #include "lyx_main.h"
index d066cc4afb9ed5322288ca1611d81301868c3984..43d29e2173b06d2b0f02393d698fefe87b56c9b3 100644 (file)
@@ -8,8 +8,8 @@
 #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 */
index b6cab06a4a9877e205294a1a9c61416f82482933..ebde3c0049cedb57c1f254b5ec1b3594cc762b06 100644 (file)
@@ -7,8 +7,8 @@
 #endif
 
 #include FORMS_H_LOCATION 
-#include "filedlg.h" 
 #include "insetinclude.h"
+#include "filedlg.h" 
 #include "buffer.h"
 #include "bufferlist.h"
 #include "debug.h"
index 33d14a39cedfe8509d0cf939108dfd3f610e8c8c..826f1bdcf8afa1c0c2909260221abf0333633cbe 100644 (file)
 #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 
 {
index 99aabd337471b145b78f258b4bf986462ef0881f..69c358a4167e3da87e58ccc06185f40270b06bd8 100644 (file)
 #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();
 
index 7faa2ad30028473c6c3702ca310a35c2ddddf99c..e8162459e8b4623a549ad303e6bb3e0f160c3a79 100644 (file)
 #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;
index a89e60394c2c287ef14cc66bf8adb513c1c116fe..9692a6bd6b6057f254a42f0f7435a0d0cdad6c4e 100644 (file)
@@ -17,7 +17,7 @@
 /* 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[] = 
     {
@@ -357,7 +357,7 @@ in_word_set (register char const *str, register int len)
 {
   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)
         {
index 361a6b1f687c4c2e99e152a3796dd690a081a726..4380423038ccca353a9c8c3544845aa276dacae6 100644 (file)
 #pragma interface
 #endif
 
+#include "LString.h"
+
 #include <vector>
 using std::vector;
 using std::pair;
 
-#include "LString.h"
-
 ///
 class LRegex {
 public:
index 0cdb4e3bdd0ce9aba3ccb80d32ca246291f2bd44..47f3e8d5874a7071780541af8af30d5d71550d8b 100644 (file)
@@ -16,7 +16,7 @@
 #pragma implementation "lyxstring.h"
 #endif
 
-#include "lyxstring.h"
+#include "LString.h"
 #include <cstdlib>
 #include <cctype>
 #include <algorithm>
@@ -1445,6 +1445,19 @@ lyxstring::size_type lyxstring::copy(value_type * buf, size_type len,
 }
 
 
+#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
 ////////////////////
index 4f9af2af8ff688278682912c657108569a899fa3..bd7e6411bad9e7732d0df00677bd066bb128f586 100644 (file)
 #pragma interface
 #endif
 
-#include <list>
-using std::list;
-
 #include "lyxparagraph.h"
 
+#include <list>
+using std::list;
 
 ///
 class Undo {