From 9846e7879c9501658ba2bc15fb325da73cbfd793 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 24 May 2011 20:00:56 +0000 Subject: Fix constructors for VC++ DLL builds (STR #2645). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8736 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Browser.cxx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src') diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index febdb6a06..f4fbcfd24 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -32,6 +32,12 @@ #include #include +#if defined(FL_DLL) // really needed for c'tors for MS VC++ only +#include +#include +#include +#endif + // I modified this from the original Forms data to use a linked list // so that the number of items in the browser and size of those items // is unlimited. The only problem is that the old browser used an @@ -914,6 +920,30 @@ void Fl_Browser::remove_icon(int line) { icon(line,0); } +/* + The following constructors must not be in the header file(s) if we + build a shared object (DLL). Instead they are defined here to force + the constructor (and default destructor as well) to be defined in + the DLL and exported (STR #2632, #2645). + + Note: if you change any of them, do the same changes in the specific + header file as well. This redundant definition was chosen to enable + inline constructors in the header files (for static linking) as well + as those here for dynamic linking (Windows DLL). +*/ +#if defined(FL_DLL) + + Fl_Hold_Browser::Fl_Hold_Browser(int X,int Y,int W,int H,const char *L) + : Fl_Browser(X,Y,W,H,L) {type(FL_HOLD_BROWSER);} + + Fl_Multi_Browser::Fl_Multi_Browser(int X,int Y,int W,int H,const char *L) + : Fl_Browser(X,Y,W,H,L) {type(FL_MULTI_BROWSER);} + + Fl_Select_Browser::Fl_Select_Browser(int X,int Y,int W,int H,const char *L) + : Fl_Browser(X,Y,W,H,L) {type(FL_SELECT_BROWSER);} + +#endif // FL_DLL + // // End of "$Id$". // -- cgit v1.2.3