# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1672356012 0 # Node ID 248e32f744f08369e5cf2a1e9edebbd33e36c122 # Parent 969cc3b8bec227accab37808ff31c4ff902a511b C++: Attempt to get dwtestoo working with old pre-lambda compilers. Fixed a number of errors regarding this from the last commit, however... GCC 4.2 errors out complaining about forward declaration of class Pixmap. This forward definition is necessary to define some classes that reference each other. The issue seems to be these old GCC implmentations expect... that these classes be defined in different files. Since I forward declare Pixmap before defining Render which uses it, then when I go to define Pixmap, it is already forward declared and gives errors. This code is legit, but the compiler implementation is erroring out.... Not sure how to fix this right now without defining them in separate files. diff -r 969cc3b8bec2 -r 248e32f744f0 dw.hpp --- a/dw.hpp Thu Dec 29 21:56:58 2022 +0000 +++ b/dw.hpp Thu Dec 29 23:20:12 2022 +0000 @@ -1212,7 +1212,10 @@ } protected: void Setup() { +#ifdef DW_LAMBDA _ConnectValueChanged = 0; +#endif + _ConnectValueChangedOld = 0; if(IsOverridden(Ranged::OnValueChanged, this)) { dw_signal_connect(hwnd, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(_OnValueChanged), this); ValueChangedConnected = true; @@ -1332,7 +1335,10 @@ } protected: void Setup() { +#ifdef DW_LAMBDA _ConnectSwitchPage = 0; +#endif + _ConnectSwitchPageOld = 0; if(IsOverridden(Notebook::OnSwitchPage, this)) { dw_signal_connect(hwnd, DW_SIGNAL_SWITCH_PAGE, DW_SIGNAL_FUNC(_OnSwitchPage), this); SwitchPageConnected = true; @@ -1821,7 +1827,14 @@ } public: // Constructors - Timer(int interval) { _ConnectTimer = 0; timer = dw_timer_connect(interval, DW_SIGNAL_FUNC(_OnTimer), this); SetHandle(reinterpret_cast(timer)); } + Timer(int interval) { +#ifdef DW_LAMBDA + _ConnectTimer = 0; +#endif + _ConnectTimerOld = 0; + timer = dw_timer_connect(interval, DW_SIGNAL_FUNC(_OnTimer), this); + SetHandle(reinterpret_cast(timer)); + } #ifdef DW_LAMBDA Timer(int interval, std::function userfunc) { _ConnectTimer = userfunc; diff -r 969cc3b8bec2 -r 248e32f744f0 dwtestoo.cpp --- a/dwtestoo.cpp Thu Dec 29 21:56:58 2022 +0000 +++ b/dwtestoo.cpp Thu Dec 29 23:20:12 2022 +0000 @@ -56,14 +56,14 @@ } }; -int button_clicked(Clickable *classptr) +int button_clicked(DW::Clickable *classptr) { DW::App *app = DW::App::Init(); app->MessageBox("Button", DW_MB_OK | DW_MB_INFORMATION, "Clicked!"); return TRUE; } -int exit_handler(Clickable *classptr) +int exit_handler(DW::Clickable *classptr) { DW::App *app = DW::App::Init(); if(app->MessageBox(APP_TITLE, DW_MB_YESNO | DW_MB_QUESTION, APP_EXIT) != 0) {