Mercurial > dwindows
diff dwtestoo.cpp @ 2895:5a6bf6bd3001
C++: Divide up C++11 and Lambda support since some compilers can
support lambdas without full C++11 support. For instance MSVC 2010
supports lambdas but only MSVC 2017 supports C++11 or higher.
GCC 4.5 supports lambdas but GCC 4.8.1 supports C++11.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 23 Dec 2022 04:13:51 +0000 |
parents | 4b075e64536c |
children | 8af64b6d75a9 |
line wrap: on
line diff
--- a/dwtestoo.cpp Fri Dec 23 02:56:29 2022 +0000 +++ b/dwtestoo.cpp Fri Dec 23 04:13:51 2022 +0000 @@ -14,7 +14,7 @@ int OnConfigure(int width, int height) override { return FALSE; } }; -#ifndef DW_CPP11 +#ifndef DW_LAMBDA int button_clicked() { DW::App *app = DW::App::Init(); @@ -39,7 +39,7 @@ DW::Button *button = new DW::Button("Test window"); window->PackStart(button, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, TRUE, 0); -#ifdef DW_CPP11 +#ifdef DW_LAMBDA button->ConnectClicked([app] () -> int { app->MessageBox("Button", DW_MB_OK | DW_MB_WARNING, "Clicked!"); @@ -54,7 +54,7 @@ // add menus to the menubar DW::Menu *menu = new DW::Menu(); DW::MenuItem *menuitem = menu->AppendItem("~Quit"); -#ifdef DW_CPP11 +#ifdef DW_LAMBDA menuitem->ConnectClicked([app] () -> int { if(app->MessageBox("dwtest", DW_MB_YESNO | DW_MB_QUESTION, "Are you sure you want to exit?") != 0) {