]> git.lyx.org Git - features.git/commitdiff
A bunch of obvious changes to please strict ansi compilers. Not finished.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 19 Oct 1999 15:06:30 +0000 (15:06 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 19 Oct 1999 15:06:30 +0000 (15:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@210 a592a061-630c-0410-9148-cb99ea01b6c8

36 files changed:
ChangeLog
src/LyXAction.C
src/bmtable.C
src/bullet_forms.h
src/credits_form.h
src/form1.h
src/include_form.h
src/insets/figinset.C
src/insets/insetbib.C
src/insets/inseterror.C
src/insets/inseterror.h
src/insets/insetinclude.C
src/insets/insetindex.C
src/insets/insetinfo.C
src/insets/insetinfo.h
src/insets/inseturl.C
src/insets/inseturl.h
src/latexoptions.h
src/layout_forms.h
src/lyx.h
src/lyx_cb.C
src/lyx_cb.h
src/lyx_gui.C
src/lyx_gui_misc.C
src/lyx_sendfax.h
src/mathed/math_forms.h
src/mathed/math_panel.C
src/mathed/math_panel.h
src/mathed/math_symbols.C
src/mathed/math_utils.C
src/print_form.h
src/sp_form.h
src/support/DebugStream.h
src/support/lstrings.C
src/support/lyxstring.C
src/toolbar.C

index 607dd84585ce9b9f2a91ff447e69124f7432d4d8..b80bba59d937f2338924fbac9a3a8d77fb04216c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+1999-10-19  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * src/mathed/math_symbols.C, src/support/lstrings.C,
+       src/support/lyxstring.C: add `using' directive to specify what
+       we need in <algorithm>. I do not think that we need to
+       conditionalize this, but any thought is appreciated.
+
+       * many files: change all callback functions to "C" linkage
+       functions to please strict C++ compilers like DEC cxx 6.1 in mode
+       strict_ansi. Those who were static are now global. 
+           The case of callbacks which are static class members is
+       trickier, since we have to make C wrappers around them (see
+       InsetError, InsetInfo and InsetUrl). The same holds for friends. I
+       did not finish this yet, since it defeats the purpose of
+       encapsulation, and I am not sure what the best route is.
+
 1999-10-19  Juergen Vigna  <jug@sad.it>
 
        * src/support/lyxstring.C (lyxstring): we permit to have a null
index 55247ae1c061bfb784e4f0e3af1c762212be734f..15c535bd6bf36a694f774514b6eb48c99a8bbd52 100644 (file)
@@ -717,7 +717,7 @@ char const *LyXAction::helpText(kb_action action) const
 
 
 // Function to compare items from the attrib table.
-int actioncomp(const void *a, const void *b)
+extern "C" int actioncomp(const void *a, const void *b)
 {
     int const *ia=(int const*)a, *ib=(int const*)b;
     return (*ia)-(*ib);
index a479397a48a0bca0290ac198fe442b2f9b3bd636..bf0b0f9842f1cb556c9d84fda907c5475902d0b2 100644 (file)
@@ -32,8 +32,8 @@ typedef struct   {
 } BMTABLE_SPEC;
                  
 
-static int handle_bitmaptable(FL_OBJECT *ob, int event, FL_Coord mx, 
-                             FL_Coord my, int key, void *xev);
+extern "C" int handle_bitmaptable(FL_OBJECT *ob, int event, FL_Coord mx, 
+                                 FL_Coord my, int key, void *xev);
 
 
 FL_OBJECT *fl_create_bmtable(int type, FL_Coord x, FL_Coord y, 
@@ -165,8 +165,8 @@ static void draw_bitmaptable(FL_OBJECT *ob)
 }
 
 
-static int handle_bitmaptable(FL_OBJECT *ob, int event, FL_Coord mx, 
-                             FL_Coord my, int key, void */*xev*/)
+extern "C" int handle_bitmaptable(FL_OBJECT *ob, int event, FL_Coord mx, 
+                                 FL_Coord my, int key, void */*xev*/)
 {
        int i, j;
        BMTABLE_SPEC *sp = (BMTABLE_SPEC *)ob->spec;
index 5c9293157d023bd8060ae6f30a24c09445c55c50..4ff02108fb579a88860a9d2aa99430ef039b5d87 100644 (file)
@@ -4,14 +4,14 @@
 #define FD_form_bullet_h_
 
 /** Callbacks, globals and object handlers **/
-extern void ChoiceBulletSizeCB(FL_OBJECT *, long);
-extern void BulletOKCB(FL_OBJECT *, long);
-extern void BulletApplyCB(FL_OBJECT *, long);
-extern void BulletCancelCB(FL_OBJECT *, long);
-extern void InputBulletLaTeXCB(FL_OBJECT *, long);
-extern void BulletDepthCB(FL_OBJECT *, long);
-extern void BulletPanelCB(FL_OBJECT *, long);
-extern void BulletBMTableCB(FL_OBJECT *, long);
+extern "C" void ChoiceBulletSizeCB(FL_OBJECT *, long);
+extern "C" void BulletOKCB(FL_OBJECT *, long);
+extern "C" void BulletApplyCB(FL_OBJECT *, long);
+extern "C" void BulletCancelCB(FL_OBJECT *, long);
+extern "C" void InputBulletLaTeXCB(FL_OBJECT *, long);
+extern "C" void BulletDepthCB(FL_OBJECT *, long);
+extern "C" void BulletPanelCB(FL_OBJECT *, long);
+extern "C" void BulletBMTableCB(FL_OBJECT *, long);
 
 
 /**** Additional routines ****/
index 58ac09947dcb33f5890d5b34fdd96aa66de6b856..5cd8777eb4cad6e77e8dea70b4899ce3001b3a6d 100644 (file)
@@ -4,9 +4,9 @@
 #define FD_form_credits_h_
 
 /** Callbacks, globals and object handlers **/
-extern void CreditsOKCB(FL_OBJECT *, long);
+extern "C" void CreditsOKCB(FL_OBJECT *, long);
 
-extern void CopyrightOKCB(FL_OBJECT *, long);
+extern "C" void CopyrightOKCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index cf2ab3fe16d5d962ab653e86665c5bb9a8cce664..511aa55ebb2982daa03bc590404b8ffe705c0cdb 100644 (file)
@@ -5,18 +5,18 @@
 
 /** Callbacks, globals and object handlers **/
 
-extern void GraphicsCB(FL_OBJECT *, long);
+extern "C" void GraphicsCB(FL_OBJECT *, long);
 
 
-extern void TableOKCB(FL_OBJECT *, long);
-extern void TableApplyCB(FL_OBJECT *, long);
-extern void TableCancelCB(FL_OBJECT *, long);
+extern "C" void TableOKCB(FL_OBJECT *, long);
+extern "C" void TableApplyCB(FL_OBJECT *, long);
+extern "C" void TableCancelCB(FL_OBJECT *, long);
 
-extern void SearchForwardCB(FL_OBJECT *, long);
-extern void SearchBackwardCB(FL_OBJECT *, long);
-extern void SearchReplaceCB(FL_OBJECT *, long);
-extern void SearchCancelCB(FL_OBJECT *, long);
-extern void SearchReplaceAllCB(FL_OBJECT *, long);
+extern "C" void SearchForwardCB(FL_OBJECT *, long);
+extern "C" void SearchBackwardCB(FL_OBJECT *, long);
+extern "C" void SearchReplaceCB(FL_OBJECT *, long);
+extern "C" void SearchCancelCB(FL_OBJECT *, long);
+extern "C" void SearchReplaceAllCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index eb333f4b3f17124bc219d107d0a287c2c58fc047..a4c99ea019f785d8a41bb088272716b3300ed4fc 100644 (file)
@@ -4,7 +4,7 @@
 
 /**** Callback routines ****/
 
-extern void include_cb(FL_OBJECT *, long);
+extern "C" void include_cb(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index 82f72a2cb12fd5eb8b331151fabe3f1ccc879039..c85889ae60f8ade5a25e121920a90e17ff7224ed 100644 (file)
@@ -60,8 +60,8 @@ extern BufferView *current_view;
 static volatile bool alarmed;
 
 extern FL_OBJECT *figinset_canvas;
-inline
-void waitalarm(int)
+//inline
+extern "C" void waitalarm(int)
 {
        alarmed = true;
 }
@@ -136,7 +136,7 @@ void addpidwait(int pid)
 }
 
 
-int GhostscriptMsg(FL_OBJECT *, Window, int, int,
+extern "C" int GhostscriptMsg(FL_OBJECT *, Window, int, int,
                   XEvent *ev, void *)
 {
        int i;
index ab5ed93f8c6de68ce10ce27aecfffccaee969db1..e66147d3a94ef8c56c20a9ee5743253c7fc9cdd3 100644 (file)
@@ -27,12 +27,11 @@ static Combox *bibcombox = 0;
 
 extern void UpdateInset(Inset* inset, bool mark_dirty = true);
 void BibitemUpdate(Combox *);
-void bibitem_cb(FL_OBJECT *, long);
 FD_citation_form * create_form_citation_form(void);
 FD_bibitem_form * create_form_bibitem_form(void);
 
 
-void bibitem_cb(FL_OBJECT *, long data)
+extern "C" void bibitem_cb(FL_OBJECT *, long data)
 {
        switch (data) {
 //       case 0: fl_hide_form(citation_form->citation_form);
index 869d349757c836d764a337278b035d6b443d6c8d..09c1cd4dd1f2de4169ab6f18985e80c90ea9117f 100644 (file)
@@ -150,6 +150,13 @@ void InsetError::CloseErrorCB(FL_OBJECT *, long data)
        }
 }
 
+// A C wrapper
+extern "C" void C_InsetError_CloseErrorCB(FL_OBJECT *, long data)
+{
+        InsetError::CloseErrorCB(0,data);
+}
+
+
 void InsetError::Edit(int, int)
 {
        if (!form) {
@@ -159,7 +166,7 @@ void InsetError::Edit(int, int)
                fl_set_object_color(strobj,FL_MCOL,FL_MCOL);
                fl_set_object_gravity(strobj, FL_NorthWest, FL_SouthEast);
                obj = fl_add_button(FL_RETURN_BUTTON,140,200,120,30,_("Close"));
-               fl_set_object_callback(obj, CloseErrorCB, (long)this);
+               fl_set_object_callback(obj, C_InsetError_CloseErrorCB, (long)this);
                fl_set_object_gravity(obj, FL_South, FL_South);
                fl_set_object_resize(obj, FL_RESIZE_NONE);
                fl_end_form();
index 59b9cfcb5850de39e2ecc4004b025f1f69628aed..cdc03f41dcae981bc9b287bbff68ce92587f80c2 100644 (file)
@@ -67,6 +67,8 @@ public:
        Inset::Code LyxCode() const { return Inset::NO_CODE; }
        /// We don't want "begin" and "end inset" in lyx-file
        bool DirectWrite() const { return true; };
+       ///
+       static void CloseErrorCB(FL_OBJECT *, long data);
 private:
        ///
        string contents;
@@ -74,7 +76,5 @@ private:
        FL_FORM *form;
        ///
        FL_OBJECT *strobj;
-       ///
-       static void CloseErrorCB(FL_OBJECT *, long data);
 };
 #endif
index f10b1f0a481ca2c50be5b66ee2cf44801bf71c37..554ae2a3cb8a9e04c2ca0229f3f78d320656b66f 100644 (file)
@@ -88,7 +88,7 @@ FD_include *create_form_include(void)
 
 FD_include *form = 0;
 
-void include_cb(FL_OBJECT *, long arg)
+extern "C" void include_cb(FL_OBJECT *, long arg)
 {
     
        InsetInclude *inset = (InsetInclude*)form->vdata;
index 018d9370f62789675557f2f5427d4f8401e887ce..035c3dd51169421205147b166d25d3000b203377 100644 (file)
@@ -20,8 +20,7 @@ extern void UpdateInset(Inset* inset, bool mark_dirty = true);
 
 FD_index_form *index_form = 0;
 
-static
-void index_cb(FL_OBJECT *, long data)
+extern "C" void index_cb(FL_OBJECT *, long data)
 {
        InsetIndex *inset = (InsetIndex*)index_form->vdata;
        
index 9174dd00b2c4b3ef2c068c9702503216761ff2b8..00665337ae07aba68c00762b0286e21fd48565b9 100644 (file)
@@ -170,6 +170,11 @@ void InsetInfo::CloseInfoCB(FL_OBJECT *, long data)
        }
 }
 
+// This is just a wrapper.
+extern "C" void C_InsetInfo_CloseInfoCB(FL_OBJECT *, long data) 
+{
+       InsetInfo::CloseInfoCB(0, data);
+}
 
 void InsetInfo::Edit(int, int)
 {
@@ -186,7 +191,7 @@ void InsetInfo::Edit(int, int)
                obj = fl_add_button(FL_NORMAL_BUTTON,130,140,120,30,idex(_("Close|#C^[")));
                fl_set_object_resize(obj, FL_RESIZE_NONE);
                fl_set_object_gravity(obj, SouthWestGravity, SouthEastGravity);
-               fl_set_object_callback(obj, CloseInfoCB, (long)this);
+               fl_set_object_callback(obj, C_InsetInfo_CloseInfoCB, (long)this);
                fl_set_object_shortcut(obj, scex(_("Close|#C^[")), (long)this);
                fl_end_form();
                fl_set_form_atclose(form, CancelCloseBoxCB, 0);
index 67eb0499eb992dce2d8269f75e877295a6748700..edd3e9fa1e33d76713bd6e7aea6d5ca566c6e6ca 100644 (file)
@@ -65,6 +65,8 @@ public:
        Inset::Code LyxCode() const;
        ///
        Inset* Clone();
+       ///
+       static void CloseInfoCB(FL_OBJECT *, long data);
 private:
        ///
        string contents;
@@ -72,8 +74,6 @@ private:
        FL_FORM *form;
        ///
        FL_OBJECT *strobj;
-       ///
-       static void CloseInfoCB(FL_OBJECT *, long data);
 };
 
 #endif
index 5124c15455d39057ec3a95e80e4cfd673b6d00b3..b7efb774c09f43b21d443c85a5f8ddc3a10e0169 100644 (file)
@@ -99,6 +99,10 @@ void InsetUrl::CloseUrlCB(FL_OBJECT *ob, long)
        }
 }
 
+extern "C" void C_InsetUrl_CloseUrlCB(FL_OBJECT *ob, long)
+{
+       InsetUrl::CloseUrlCB(0,0);
+}
 
 void InsetUrl::Edit(int, int)
 {
@@ -116,7 +120,7 @@ void InsetUrl::Edit(int, int)
                obj = fl_add_button(FL_RETURN_BUTTON,360,130,100,30,idex(_("Close|#C^[^M")));
                fl_set_button_shortcut(obj,scex(_("Close|#C^[^M")),1);
                obj->u_vdata = this;
-               fl_set_object_callback(obj,CloseUrlCB,0);
+               fl_set_object_callback(obj,C_InsetUrl_CloseUrlCB,0);
                radio_html = obj = fl_add_checkbutton(FL_PUSH_BUTTON,50,130,240,30,idex(_("HTML type|#H")));
                fl_set_button_shortcut(obj,scex(_("HTML type|#H")),1);
                fl_set_object_lsize(obj,FL_NORMAL_SIZE);
index 3e6c3cb06e94ca360730a554162df6ba40d985f0..d54768be8788a0433184e9c0ccad522d54a66e90 100644 (file)
@@ -74,6 +74,8 @@ public:
        int Linuxdoc(string &file);
        ///
        int DocBook(string &file);
+       ///
+       static void CloseUrlCB(FL_OBJECT *, long data);
 private:
        ///
         Url_Flags flag;
@@ -85,8 +87,6 @@ private:
        FL_OBJECT *name_name;
        ///
        FL_OBJECT *radio_html;
-       ///
-       static void CloseUrlCB(FL_OBJECT *, long data);
 };
 
 #endif
index c325c9ebd7b79c50ca028e9066005a1829e32683..3a4161688baa97a67f25dff42811986e24fe5162 100644 (file)
@@ -4,12 +4,12 @@
 #define FD_LaTeXOptions_h_
 
 /** Callbacks, globals and object handlers **/
-extern void LaTeXOptionsOK(FL_OBJECT *, long);
-extern void LaTeXOptionsApply(FL_OBJECT *, long);
-extern void LaTeXOptionsCancel(FL_OBJECT *, long);
+extern "C" void LaTeXOptionsOK(FL_OBJECT *, long);
+extern "C" void LaTeXOptionsApply(FL_OBJECT *, long);
+extern "C" void LaTeXOptionsCancel(FL_OBJECT *, long);
 
-extern void LatexLogClose(FL_OBJECT *, long);
-extern void LatexLogUpdate(FL_OBJECT *, long);
+extern "C" void LatexLogClose(FL_OBJECT *, long);
+extern "C" void LatexLogUpdate(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index 901d7c63cba941c986f1fe9f5fad95baf2a3f723..5446b986ee4461e68b954f8cb6ebb5d3ce6e4beb 100644 (file)
@@ -4,47 +4,47 @@
 #define FD_form_document_h_
 
 /** Callbacks, globals and object handlers **/
-extern void ChoiceClassCB(FL_OBJECT *, long);
-extern void DocumentCancelCB(FL_OBJECT *, long);
-extern void DocumentApplyCB(FL_OBJECT *, long);
-extern void DocumentOKCB(FL_OBJECT *, long);
-extern void DocumentDefskipCB(FL_OBJECT *, long);
-extern void DocumentSpacingCB(FL_OBJECT *, long);
-extern void DocumentBulletsCB(FL_OBJECT *, long);
+extern "C" void ChoiceClassCB(FL_OBJECT *, long);
+extern "C" void DocumentCancelCB(FL_OBJECT *, long);
+extern "C" void DocumentApplyCB(FL_OBJECT *, long);
+extern "C" void DocumentOKCB(FL_OBJECT *, long);
+extern "C" void DocumentDefskipCB(FL_OBJECT *, long);
+extern "C" void DocumentSpacingCB(FL_OBJECT *, long);
+extern "C" void DocumentBulletsCB(FL_OBJECT *, long);
 
-extern void CharacterApplyCB(FL_OBJECT *, long);
-extern void CharacterCloseCB(FL_OBJECT *, long);
+extern "C" void CharacterApplyCB(FL_OBJECT *, long);
+extern "C" void CharacterCloseCB(FL_OBJECT *, long);
 
-extern void ParagraphOKCB(FL_OBJECT *, long);
-extern void ParagraphApplyCB(FL_OBJECT *, long);
-extern void ParagraphCancelCB(FL_OBJECT *, long);
-extern void ParagraphVSpaceCB(FL_OBJECT *, long);
-extern void ParagraphExtraOpen(FL_OBJECT *, long);
+extern "C" void ParagraphOKCB(FL_OBJECT *, long);
+extern "C" void ParagraphApplyCB(FL_OBJECT *, long);
+extern "C" void ParagraphCancelCB(FL_OBJECT *, long);
+extern "C" void ParagraphVSpaceCB(FL_OBJECT *, long);
+extern "C" void ParagraphExtraOpen(FL_OBJECT *, long);
 
-extern void PreambleOKCB(FL_OBJECT *, long);
-extern void PreambleApplyCB(FL_OBJECT *, long);
-extern void PreambleCancelCB(FL_OBJECT *, long);
+extern "C" void PreambleOKCB(FL_OBJECT *, long);
+extern "C" void PreambleApplyCB(FL_OBJECT *, long);
+extern "C" void PreambleCancelCB(FL_OBJECT *, long);
 
-extern void QuotesOKCB(FL_OBJECT *, long);
-extern void QuotesApplyCB(FL_OBJECT *, long);
-extern void QuotesCancelCB(FL_OBJECT *, long);
+extern "C" void QuotesOKCB(FL_OBJECT *, long);
+extern "C" void QuotesApplyCB(FL_OBJECT *, long);
+extern "C" void QuotesCancelCB(FL_OBJECT *, long);
 
-extern void PaperMarginsCB(FL_OBJECT *, long);
-extern void PaperCancelCB(FL_OBJECT *, long);
-extern void PaperApplyCB(FL_OBJECT *, long);
-extern void PaperOKCB(FL_OBJECT *, long);
+extern "C" void PaperMarginsCB(FL_OBJECT *, long);
+extern "C" void PaperCancelCB(FL_OBJECT *, long);
+extern "C" void PaperApplyCB(FL_OBJECT *, long);
+extern "C" void PaperOKCB(FL_OBJECT *, long);
 
-extern void TableOptCloseCB(FL_OBJECT *, long);
-extern void TableOptionsCB(FL_OBJECT *, long);
-extern void SetPWidthCB(FL_OBJECT *, long);
+extern "C" void TableOptCloseCB(FL_OBJECT *, long);
+extern "C" void TableOptionsCB(FL_OBJECT *, long);
+extern "C" void SetPWidthCB(FL_OBJECT *, long);
 
-extern void CheckPExtraOptCB(FL_OBJECT *, long);
-extern void ParagraphExtraOKCB(FL_OBJECT *, long);
-extern void ParagraphExtraApplyCB(FL_OBJECT *, long);
-extern void ParagraphExtraCancelCB(FL_OBJECT *, long);
+extern "C" void CheckPExtraOptCB(FL_OBJECT *, long);
+extern "C" void ParagraphExtraOKCB(FL_OBJECT *, long);
+extern "C" void ParagraphExtraApplyCB(FL_OBJECT *, long);
+extern "C" void ParagraphExtraCancelCB(FL_OBJECT *, long);
 
-extern void TableOptionsCB(FL_OBJECT *, long);
-extern void TableSpeCloseCB(FL_OBJECT *, long);
+extern "C" void TableOptionsCB(FL_OBJECT *, long);
+extern "C" void TableSpeCloseCB(FL_OBJECT *, long);
 
 /* Additional Functions/Methods */
 
index 4dec39e7dea26f3f7d68d3601f20247551adb78b..6677d3d37ac14e4614303f1c973e131cb79e464d 100644 (file)
--- a/src/lyx.h
+++ b/src/lyx.h
@@ -4,23 +4,23 @@
 #define FD_form_title_h_
 
 /** Callbacks, globals and object handlers **/
-extern void TimerCB(FL_OBJECT *, long);
+extern "C" void TimerCB(FL_OBJECT *, long);
 
-extern void FigureOKCB(FL_OBJECT *, long);
-extern void FigureApplyCB(FL_OBJECT *, long);
-extern void FigureCancelCB(FL_OBJECT *, long);
+extern "C" void FigureOKCB(FL_OBJECT *, long);
+extern "C" void FigureApplyCB(FL_OBJECT *, long);
+extern "C" void FigureCancelCB(FL_OBJECT *, long);
 
-extern void ScreenOKCB(FL_OBJECT *, long);
-extern void ScreenApplyCB(FL_OBJECT *, long);
-extern void ScreenCancelCB(FL_OBJECT *, long);
+extern "C" void ScreenOKCB(FL_OBJECT *, long);
+extern "C" void ScreenApplyCB(FL_OBJECT *, long);
+extern "C" void ScreenCancelCB(FL_OBJECT *, long);
 
-extern void TocSelectCB(FL_OBJECT *, long);
-extern void TocCancelCB(FL_OBJECT *, long);
-extern void TocUpdateCB(FL_OBJECT *, long);
+extern "C" void TocSelectCB(FL_OBJECT *, long);
+extern "C" void TocCancelCB(FL_OBJECT *, long);
+extern "C" void TocUpdateCB(FL_OBJECT *, long);
 
-extern void RefUpdateCB(FL_OBJECT *, long);
-extern void RefHideCB(FL_OBJECT *, long);
-extern void RefSelectCB(FL_OBJECT *, long);
+extern "C" void RefUpdateCB(FL_OBJECT *, long);
+extern "C" void RefHideCB(FL_OBJECT *, long);
+extern "C" void RefSelectCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index 6bea5130bcb2cbc422b6f466e64f83be3c82a1d6..132a446a89785a600957ca3b076df41bce0b0b60 100644 (file)
@@ -1206,7 +1206,7 @@ void MenuPasteSelection(char at)
 }
 
 
-void FootCB(FL_OBJECT*, long)
+extern "C" void FootCB(FL_OBJECT*, long)
 {
        if (!current_view->available()) 
                return;
@@ -2305,7 +2305,7 @@ void ToggleAndShow(LyXFont const & font)
 }
 
 
-void MarginCB(FL_OBJECT *, long)
+extern "C" void MarginCB(FL_OBJECT *, long)
 {
        if (current_view->available()) {
                minibuffer->Set(_("Inserting margin note..."));
@@ -2317,7 +2317,7 @@ void MarginCB(FL_OBJECT *, long)
 }
 
 
-void FigureCB(FL_OBJECT *, long)
+extern "C" void FigureCB(FL_OBJECT *, long)
 {
        if (fd_form_figure->form_figure->visible) {
                fl_raise_form(fd_form_figure->form_figure);
@@ -2329,7 +2329,7 @@ void FigureCB(FL_OBJECT *, long)
 }
 
 
-void TableCB(FL_OBJECT *, long)
+extern "C" void TableCB(FL_OBJECT *, long)
 {
        if (fd_form_table->form_table->visible) {
                fl_raise_form(fd_form_table->form_table);
@@ -2411,7 +2411,7 @@ void PasteCB()
 }
 
 
-void MeltCB(FL_OBJECT *, long)
+extern "C" void MeltCB(FL_OBJECT *, long)
 {
        if (!current_view->available()) return;
        
@@ -2428,7 +2428,7 @@ void MeltCB(FL_OBJECT *, long)
 // if decInc == 0, depth change taking mouse button number into account
 // if decInc == 1, increment depth
 // if decInc == -1, decrement depth
-void DepthCB(FL_OBJECT *ob, long decInc)
+extern "C" void DepthCB(FL_OBJECT *ob, long decInc)
 {
        int button = 1;
 
@@ -2551,7 +2551,7 @@ void FreeCB()
 
 
 /* callbacks for form form_title */
-void TimerCB(FL_OBJECT *, long)
+extern "C" void TimerCB(FL_OBJECT *, long)
 {
        // only if the form still exists
        if (fd_form_title->form_title != 0) {
@@ -2566,7 +2566,7 @@ void TimerCB(FL_OBJECT *, long)
 
 /* callbacks for form form_paragraph */
 
-void ParagraphVSpaceCB(FL_OBJECT* obj, long )
+extern "C" void ParagraphVSpaceCB(FL_OBJECT* obj, long )
 {
        // "Synchronize" the choices and input fields, making it
        // impossible to commit senseless data.
@@ -2617,7 +2617,7 @@ void ParagraphVSpaceCB(FL_OBJECT* obj, long )
 }
 
 
-void ParagraphApplyCB(FL_OBJECT *, long)
+extern "C" void ParagraphApplyCB(FL_OBJECT *, long)
 {
        if (!current_view->available())
                return;
@@ -2693,13 +2693,13 @@ void ParagraphApplyCB(FL_OBJECT *, long)
 }
 
 
-void ParagraphCancelCB(FL_OBJECT *, long)
+extern "C" void ParagraphCancelCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_paragraph->form_paragraph);
 }
 
 
-void ParagraphOKCB(FL_OBJECT *ob, long data)
+extern "C" void ParagraphOKCB(FL_OBJECT *ob, long data)
 {
        ParagraphApplyCB(ob, data);
        ParagraphCancelCB(ob, data);
@@ -2708,7 +2708,7 @@ void ParagraphOKCB(FL_OBJECT *ob, long data)
 
 /* callbacks for form form_character */
 
-void CharacterApplyCB(FL_OBJECT *, long)
+extern "C" void CharacterApplyCB(FL_OBJECT *, long)
 {
        // we set toggleall locally here, since it should be true for
        // all other uses of ToggleAndShow() (JMarc)
@@ -2718,13 +2718,13 @@ void CharacterApplyCB(FL_OBJECT *, long)
 }
 
 
-void CharacterCloseCB(FL_OBJECT *, long)
+extern "C" void CharacterCloseCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_character->form_character);
 }
 
 
-void CharacterOKCB(FL_OBJECT *ob, long data)
+extern "C" void CharacterOKCB(FL_OBJECT *ob, long data)
 {
        CharacterApplyCB(ob,data);
        CharacterCloseCB(ob,data);
@@ -2755,7 +2755,7 @@ void UpdateDocumentButtons(BufferParams const &params)
        
 }
 
-void ChoiceClassCB(FL_OBJECT *ob, long)
+extern "C" void ChoiceClassCB(FL_OBJECT *ob, long)
 {
        ProhibitInput();
        if (lyxstyle.Load(fl_get_choice(ob)-1)) {
@@ -2780,7 +2780,7 @@ void ChoiceClassCB(FL_OBJECT *ob, long)
 }
 
 
-void DocumentDefskipCB(FL_OBJECT *obj, long)
+extern "C" void DocumentDefskipCB(FL_OBJECT *obj, long)
 {
        // "Synchronize" the choice and the input field, so that it
        // is impossible to commit senseless data.
@@ -2809,7 +2809,7 @@ void DocumentDefskipCB(FL_OBJECT *obj, long)
 }
 
 
-void DocumentSpacingCB(FL_OBJECT *obj, long)
+extern "C" void DocumentSpacingCB(FL_OBJECT *obj, long)
 {
        // "Synchronize" the choice and the input field, so that it
        // is impossible to commit senseless data.
@@ -2831,7 +2831,7 @@ void DocumentSpacingCB(FL_OBJECT *obj, long)
 }
 
 
-void DocumentApplyCB(FL_OBJECT *, long)
+extern "C" void DocumentApplyCB(FL_OBJECT *, long)
 {
        bool redo = false;
        BufferParams *params = &(current_view->currentBuffer()->params);
@@ -2985,20 +2985,20 @@ void DocumentApplyCB(FL_OBJECT *, long)
 }
 
 
-void DocumentCancelCB(FL_OBJECT *, long)
+extern "C" void DocumentCancelCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_document->form_document);
 }
 
 
-void DocumentOKCB(FL_OBJECT *ob, long data)
+extern "C" void DocumentOKCB(FL_OBJECT *ob, long data)
 {
        DocumentCancelCB(ob,data);
        DocumentApplyCB(ob,data);
 }
 
 
-void DocumentBulletsCB(FL_OBJECT *, long)
+extern "C" void DocumentBulletsCB(FL_OBJECT *, long)
 {
        bulletForm();
        // bullet callbacks etc. in bullet_panel.C -- ARRae
@@ -3056,7 +3056,7 @@ void InsertCorrectQuote()
 
 /* callbacks for form form_quotes */
 
-void QuotesApplyCB(FL_OBJECT *, long)
+extern "C" void QuotesApplyCB(FL_OBJECT *, long)
 {
        if (!current_view->available())
                return;
@@ -3095,13 +3095,13 @@ void QuotesApplyCB(FL_OBJECT *, long)
 }
 
 
-void QuotesCancelCB(FL_OBJECT *, long)
+extern "C" void QuotesCancelCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_quotes->form_quotes);
 }
 
 
-void QuotesOKCB(FL_OBJECT *ob, long data)
+extern "C" void QuotesOKCB(FL_OBJECT *ob, long data)
 {
        QuotesApplyCB(ob, data);
        QuotesCancelCB(ob, data);
@@ -3111,13 +3111,13 @@ void QuotesOKCB(FL_OBJECT *ob, long data)
 
 /* callbacks for form form_preamble */
 
-void PreambleCancelCB(FL_OBJECT *, long)
+extern "C" void PreambleCancelCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_preamble->form_preamble);
 }
 
 
-void PreambleApplyCB(FL_OBJECT *, long)
+extern "C" void PreambleApplyCB(FL_OBJECT *, long)
 {
        if (!current_view->available())
                return;
@@ -3129,7 +3129,7 @@ void PreambleApplyCB(FL_OBJECT *, long)
 }
 
    
-void PreambleOKCB(FL_OBJECT *ob, long data)
+extern "C" void PreambleOKCB(FL_OBJECT *ob, long data)
 {
        PreambleApplyCB(ob, data);
        PreambleCancelCB(ob, data);
@@ -3138,7 +3138,7 @@ void PreambleOKCB(FL_OBJECT *ob, long data)
 
 /* callbacks for form form_table */
 
-void TableApplyCB(FL_OBJECT *, long)
+extern "C" void TableApplyCB(FL_OBJECT *, long)
 {
        int xsize,ysize;
        if (!current_view->getScreen())
@@ -3216,13 +3216,13 @@ void TableApplyCB(FL_OBJECT *, long)
 }
 
 
-void TableCancelCB(FL_OBJECT *, long)
+extern "C" void TableCancelCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_table->form_table);
 }
 
 
-void TableOKCB(FL_OBJECT *ob, long data)
+extern "C" void TableOKCB(FL_OBJECT *ob, long data)
 {
        TableApplyCB(ob,data);
        TableCancelCB(ob,data);
@@ -3231,7 +3231,7 @@ void TableOKCB(FL_OBJECT *ob, long data)
 
 /* callbacks for form form_print */
 
-void PrintCancelCB(FL_OBJECT *, long)
+extern "C" void PrintCancelCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_print->form_print);
 }
@@ -3243,7 +3243,7 @@ static bool stringOnlyContains (string const & LStr, const char * cset)
        return strspn(cstr,cset) == strlen(cstr) ;
 }
 
-void PrintApplyCB(FL_OBJECT *, long)
+extern "C" void PrintApplyCB(FL_OBJECT *, long)
 {
        if (!current_view->available())
                return;
@@ -3406,7 +3406,7 @@ void PrintApplyCB(FL_OBJECT *, long)
 }
 
 
-void PrintOKCB(FL_OBJECT *ob, long data)
+extern "C" void PrintOKCB(FL_OBJECT *ob, long data)
 {
        PrintCancelCB(ob, data);  
        PrintApplyCB(ob,data);
@@ -3415,7 +3415,7 @@ void PrintOKCB(FL_OBJECT *ob, long data)
 
 /* callbacks for form form_figure */
 
-void FigureApplyCB(FL_OBJECT *, long)
+extern "C" void FigureApplyCB(FL_OBJECT *, long)
 {
        if (!current_view->available())
                return;
@@ -3486,19 +3486,19 @@ void FigureApplyCB(FL_OBJECT *, long)
 }
 
    
-void FigureCancelCB(FL_OBJECT *, long)
+extern "C" void FigureCancelCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_figure->form_figure);
 }
 
 
-void FigureOKCB(FL_OBJECT *ob, long data)
+extern "C" void FigureOKCB(FL_OBJECT *ob, long data)
 {
        FigureApplyCB(ob,data);
        FigureCancelCB(ob,data);
 }
 
-void ScreenApplyCB(FL_OBJECT *, long)
+extern "C" void ScreenApplyCB(FL_OBJECT *, long)
 {
        lyxrc->roman_font_name = fl_get_input(fd_form_screen->input_roman);
        lyxrc->sans_font_name = fl_get_input(fd_form_screen->input_sans);
@@ -3514,13 +3514,13 @@ void ScreenApplyCB(FL_OBJECT *, long)
 }
 
 
-void ScreenCancelCB(FL_OBJECT *, long)
+extern "C" void ScreenCancelCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_screen->form_screen);
 }
 
 
-void ScreenOKCB(FL_OBJECT *ob, long data)
+extern "C" void ScreenOKCB(FL_OBJECT *ob, long data)
 {
        ScreenCancelCB(ob,data);
        ScreenApplyCB(ob,data);
@@ -3643,7 +3643,7 @@ struct TocList {
 static TocList* toclist = 0;
 
 
-void TocSelectCB(FL_OBJECT *ob, long)
+extern "C" void TocSelectCB(FL_OBJECT *ob, long)
 {
        if (!current_view->available())
                return;
@@ -3687,13 +3687,13 @@ void TocSelectCB(FL_OBJECT *ob, long)
 }
 
 
-void TocCancelCB(FL_OBJECT *, long)
+extern "C" void TocCancelCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_toc->form_toc);
 }
 
 
-void TocUpdateCB(FL_OBJECT *, long)
+extern "C" void TocUpdateCB(FL_OBJECT *, long)
 {
        static LyXParagraph* stapar = 0;
        TocList *tmptoclist = 0;
@@ -3799,7 +3799,7 @@ void TocUpdateCB(FL_OBJECT *, long)
 
 
 /* callbacks for form form_ref */
-void RefSelectCB(FL_OBJECT *, long data)
+extern "C" void RefSelectCB(FL_OBJECT *, long data)
 {
        if (!current_view->available())
                return;
@@ -3834,7 +3834,7 @@ void RefSelectCB(FL_OBJECT *, long data)
 }
 
 
-void RefUpdateCB(FL_OBJECT *, long)
+extern "C" void RefUpdateCB(FL_OBJECT *, long)
 {
        if (!current_view->available()) {
                fl_clear_browser(fd_form_ref->browser_ref);
@@ -3903,7 +3903,7 @@ void RefUpdateCB(FL_OBJECT *, long)
 }
 
 
-void RefHideCB(FL_OBJECT *, long)
+extern "C" void RefHideCB(FL_OBJECT *, long)
 {
        fl_hide_form(fd_form_ref->form_ref);
 }
index 2b9dfd9d6f4794575d39266aef2108ff6b465d01..503733ff2baa57574a4015f68174d6f59167ae1e 100644 (file)
@@ -16,7 +16,7 @@ extern bool quitting;
 extern bool BindFileSet;
 
 ///
-extern void FootCB(FL_OBJECT *, long);
+extern "C" void FootCB(FL_OBJECT *, long);
 ///
 extern void EmphCB();
 ///
@@ -24,17 +24,17 @@ extern void BoldCB();
 ///
 extern void NounCB();
 ///
-extern void MarginCB(FL_OBJECT *, long);
+extern "C" void MarginCB(FL_OBJECT *, long);
 ///
-extern void FigureCB(FL_OBJECT *, long);
+extern "C" void FigureCB(FL_OBJECT *, long);
 ///
-extern void TableCB(FL_OBJECT *, long);
+extern "C" void TableCB(FL_OBJECT *, long);
 ///
-extern void MeltCB(FL_OBJECT *, long);
+extern "C" void MeltCB(FL_OBJECT *, long);
 ///
 extern void TexCB();
 ///
-extern void DepthCB(FL_OBJECT *, long);
+extern "C" void DepthCB(FL_OBJECT *, long);
 ///
 extern void FreeCB();
 ///
index 50d9b48cd1dfc4b2bf45435cd1578951b2a29a98..09ea9ad82d63c211901c5a484a7c0fa77ceeb4c7 100644 (file)
@@ -144,7 +144,7 @@ FL_resource res[] =
 };
 
 
-static int LyX_XErrHandler(Display *display, XErrorEvent *xeev)
+extern "C" int LyX_XErrHandler(Display *display, XErrorEvent *xeev)
 {
 //#warning Please see if you can trigger this!
        // emergency save
index ed3e07f4947a0beb9fb369feb833a13c906ef61b..0260d6d28268d68f4cc8e6a194620435976c01d8 100644 (file)
@@ -70,14 +70,14 @@ extern void TocUpdateCB();
 extern void HideFiguresPopups();
 
 // Prevents LyX from being killed when the close box is pressed in a popup.
-int CancelCloseBoxCB(FL_FORM *, void *)
+extern "C" int CancelCloseBoxCB(FL_FORM *, void *)
 {
        return FL_CANCEL;
 }
 
 
 // Prevents LyX from being killed when the close box is pressed in a popup.
-int IgnoreCloseBoxCB(FL_FORM *, void *)
+extern "C" int IgnoreCloseBoxCB(FL_FORM *, void *)
 {
        return FL_IGNORE;
 }
index 271adffa4154d2af58417755ce64bbb5c3ce927e..60b3746c12956eb4b17d42159804872edbf541e5 100644 (file)
@@ -4,17 +4,17 @@
 #define FD_xsendfax_h_
 
 /** Callbacks, globals and object handlers **/
-extern void FaxSendCB(FL_OBJECT *, long);
-extern void FaxCancelCB(FL_OBJECT *, long);
-extern void FaxApplyCB(FL_OBJECT *, long);
-extern void FaxOpenPhonebookCB(FL_OBJECT *, long);
-extern void cb_add_phoneno(FL_OBJECT *, long);
-extern void cb_delete_phoneno(FL_OBJECT *, long);
-extern void cb_save_phoneno(FL_OBJECT *, long);
+extern "C" void FaxSendCB(FL_OBJECT *, long);
+extern "C" void FaxCancelCB(FL_OBJECT *, long);
+extern "C" void FaxApplyCB(FL_OBJECT *, long);
+extern "C" void FaxOpenPhonebookCB(FL_OBJECT *, long);
+extern "C" void cb_add_phoneno(FL_OBJECT *, long);
+extern "C" void cb_delete_phoneno(FL_OBJECT *, long);
+extern "C" void cb_save_phoneno(FL_OBJECT *, long);
 
-extern void cb_select_phoneno(FL_OBJECT *, long);
+extern "C" void cb_select_phoneno(FL_OBJECT *, long);
 
-extern void FaxLogfileCloseCB(FL_OBJECT *, long);
+extern "C" void FaxLogfileCloseCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index d2757c2b30bbfa240a1a178421ed8552d452bbe5..f093b96d95d3d829b51ba84a5047ba21257bcdbb 100644 (file)
@@ -4,6 +4,7 @@
 #define FD_panel_h_
 
 /** Callbacks, globals and object handlers **/
+extern "C" {
 extern void button_cb(FL_OBJECT *, long);
 
 extern void delim_cb(FL_OBJECT *, long);
@@ -13,7 +14,7 @@ extern void matrix_cb(FL_OBJECT *, long);
 extern void deco_cb(FL_OBJECT *, long);
 
 extern void space_cb(FL_OBJECT *, long);
-
+}
 
 /**** Forms and Objects ****/
 typedef struct {
index 942c42cc14918a39aef022ed925e4b0d94fb5e0d..959de232521fa35d474e9fb713abdeab15fde5e2 100644 (file)
@@ -244,7 +244,7 @@ void space_cb(FL_OBJECT *, long data)
    }
 }
 
-int align_filter(FL_OBJECT *, char const *, char const *cur, int c)
+extern "C" int align_filter(FL_OBJECT *, char const *, char const *cur, int c)
 {
    int n = (int)(fl_get_slider_value(fd_matrix->columns)+0.5) - strlen(cur);
    return ((c=='c'||c=='l'||c=='r') && n>=0) ? FL_VALID: FL_INVALID;
@@ -320,20 +320,19 @@ void free_symbols_form()
    }
 }
 
-int AtClose_symbols_form(FL_FORM *, void *)
+extern "C" int AtClose_symbols_form(FL_FORM *, void *)
 {
   free_symbols_form();
   return FL_IGNORE;
 }
 
-
 void show_symbols_form(LyXFunc *lf)
 {
     lyxfunc = lf;
     if (!fd_panel) {
        fd_panel = create_math_panel();
        fl_register_raw_callback(fd_panel->panel, 
-                                ButtonPressMask|KeyPressMask, peek_event);
+                                ButtonPressMask|KeyPressMask, C_peek_event);
        create_symbol_menues(fd_panel); 
        fl_set_form_atclose(fd_panel->panel, AtClose_symbols_form, 0);
     }
index c2a5456457490ab70addf0413ad032f39b5eb403..64d4de183ad279933fe0c2f988b064dbaa77981a 100644 (file)
@@ -35,17 +35,13 @@ enum  {
 ///
 typedef FL_OBJECT* FL_OBJECTP;
 
-extern "C" {
-   int peek_event(FL_FORM *, void *);
-}
-
 /// Class to manage bitmap menu bars
 class BitmapMenu {
   ///
    static BitmapMenu *active;
    ///
    friend int peek_event(FL_FORM *, void *);
- protected:
+protected:
    ///
    BitmapMenu *next, *prev;
    ///
@@ -85,6 +81,9 @@ class BitmapMenu {
    int  GetIndex(FL_OBJECT* ob);
 };
 
+// This is just a wrapper around peek_event()
+extern "C" int C_peek_event(FL_FORM *form, void *ptr);
+
 
 inline
 void BitmapMenu::Prev()  {
index 47d31664f95f3a0383f040dc412b7645fd4f6cd7..de333c6e0b4ffb9763eabdbf47c880facb651ea8 100644 (file)
 #endif
 
 #include <algorithm>
+#ifdef WITH_WARNINGS
+#warning Is it safe to use 'using' unconditionnally? 
+#endif
+using std::max;
 
 #include "lyx_main.h"
 #include "buffer.h"
@@ -132,7 +136,7 @@ static signed char Latin2Greek[] =  {
 }; 
 
 extern char** mathed_get_pixmap_from_icon(int d);
-static void math_cb(FL_OBJECT*, long);
+extern "C" void math_cb(FL_OBJECT*, long);
 static char** pixmapFromBitmapData(char const *, int, int);
 void math_insert_symbol(char const* s);
 Bool math_insert_greek(char const c);
@@ -216,7 +220,7 @@ void BitmapMenu::Create()
       bitmap[i]->u_vdata = this;
    }
    fl_end_form();
-   fl_register_raw_callback(form, KeyPressMask, peek_event);
+   fl_register_raw_callback(form, KeyPressMask, C_peek_event);
 }
 
 int BitmapMenu::GetIndex(FL_OBJECT* ob)
@@ -232,7 +236,6 @@ int BitmapMenu::GetIndex(FL_OBJECT* ob)
    return -1;
 }
 
-extern "C" {
 int peek_event(FL_FORM * /*form*/, void *xev)
 {
    if (BitmapMenu::active==0)
@@ -258,9 +261,14 @@ int peek_event(FL_FORM * /*form*/, void *xev)
    }
    return 0;  
 }
+
+// This is just a wrapper.
+extern "C" int C_peek_event(FL_FORM *form, void *ptr) {
+  return peek_event(form,ptr);
 }
 
-static void math_cb(FL_OBJECT* ob, long data)
+
+extern "C" void math_cb(FL_OBJECT* ob, long data)
 {
    BitmapMenu* menu = (BitmapMenu*)ob->u_vdata;
    int i = menu->GetIndex(ob);   
index a2a25b6ef410b00dc7f79e3062146da126403914..8609e7a9a5f237abccd3517390679256ab4c62b5 100644 (file)
@@ -54,7 +54,7 @@ struct binary_op_pair { short id, isrel; } binary_op_table[] = {
       { LM_ddagger, LMB_OPERATOR }
 };
 
-static int compara(const void *a, const void *b)
+extern "C" int compara(const void *a, const void *b)
 {
     int i = ((binary_op_pair const *)a)->id, j = ((binary_op_pair const*)b)->id;
     return i - j;
index 0a932aac06d59e3cd70cd0d9157873b1c2d2ab5f..5d5c3928b776b4a3ac9c50dc1623de6944aa4c62 100644 (file)
@@ -4,13 +4,13 @@
 #define FD_form_print_h_
 
 /** Callbacks, globals and object handlers **/
-extern void PrintOKCB(FL_OBJECT *, long);
-extern void PrintApplyCB(FL_OBJECT *, long);
-extern void PrintCancelCB(FL_OBJECT *, long);
+extern "C" void PrintOKCB(FL_OBJECT *, long);
+extern "C" void PrintApplyCB(FL_OBJECT *, long);
+extern "C" void PrintCancelCB(FL_OBJECT *, long);
 
-extern void SendtoOKCB(FL_OBJECT *, long);
-extern void SendtoApplyCB(FL_OBJECT *, long);
-extern void SendtoCancelCB(FL_OBJECT *, long);
+extern "C" void SendtoOKCB(FL_OBJECT *, long);
+extern "C" void SendtoApplyCB(FL_OBJECT *, long);
+extern "C" void SendtoCancelCB(FL_OBJECT *, long);
 
 
 /**** Forms and Objects ****/
index f84524bcc47b4becb242db8b87df840d20b166af..1d1a16058d1901216d5087ca75841cb6ae7ca5b7 100644 (file)
@@ -4,9 +4,9 @@
 #define FD_form_spell_options_h_
 
 /** Callbacks, globals and object handlers **/
-extern void SpellOptionsOKCB(FL_OBJECT *, long);
-extern void SpellOptionsCancelCB(FL_OBJECT *, long);
-extern void SpellOptionsApplyCB(FL_OBJECT *, long);
+extern "C" void SpellOptionsOKCB(FL_OBJECT *, long);
+extern "C" void SpellOptionsCancelCB(FL_OBJECT *, long);
+extern "C" void SpellOptionsApplyCB(FL_OBJECT *, long);
 
 
 
index d5be8b609dc46be8b42c625d35f8a1c188aa7be6..6fb383ed9fb91fa63585d56bdd47e50824e03e75 100644 (file)
@@ -22,7 +22,7 @@
 #include <iostream>
 #endif
 
-#ifdef MODERN_STL
+//#ifdef MODERN_STL
 using std::ostream;
 using std::streambuf;
 using std::streamsize;
@@ -30,7 +30,7 @@ using std::filebuf;
 using std::cerr;
 using std::ios;
 using std::endl; 
-#endif
+//#endif
 
 #ifdef TEST_DEBUGSTREAM
 #include <string>
index 9aa4ea0a804e768b9fce327a63cfb6323adcd5c7..18f452dcb8805b97d15d4edb5838efaa30190a95 100644 (file)
@@ -10,6 +10,8 @@
 
 //#include "debug.h"
 
+using std::count;
+
 bool isStrInt(string const & str)
 {
        if (str.empty()) return false;
index 7d7c614ed05cac2c090dc1491e3d92e2ffc663b6..32d2dd24ab4ccc8f1a4f525f74a9ca33609c6c42 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "LAssert.h"
 
+using std::min;
+
 // Reference count has been checked, empty_rep removed and
 // introduced again in a similar guise. Where is empty_rep _really_
 // needed?
index 4dba7ea114eb26a8957f95c8563d624e3141a58a..fae4601c14febd5492daf7f4c364d449c993edac 100644 (file)
@@ -92,6 +92,7 @@
 #include "layout_std.xpm"
 #include "build.xpm"
 
+// this one is not "C" because combox callbacks are really C++ %-|
 extern void LayoutsCB(int, void*);
 extern char** get_pixmap_from_symbol(char const *arg, int, int);
 extern LyXAction lyxaction;