ggerganov / imtui

ImTui: Immediate Mode Text-based User Interface C++ Library
https://imtui.ggerganov.com
MIT License
2.94k stars 123 forks source link

Adjusted Syntax #7

Closed clbx closed 4 years ago

clbx commented 4 years ago

I adjusted this syntax because I was running a build on my project that I'm using ImTui in. On my Travis CI builds the compiler did not like

if (int ch = wgetch(stdscr); ch != ERR) {

So I changed it to

int ch = wgetch(stdscr);
if (ch != ERR) {

Below are links to my builds, I'm going to look into what why it didn't seem to like that syntax since it worked fine on my local machines. This isn't a huge change, but maybe it will save a few minutes for someone down the road assuming you want to merge it in and it doesn't clash with your style too much.

Project: https://github.com/clbx/Cosmic Failing Build: https://travis-ci.org/clbx/Cosmic/builds/653635685 Passing Build (Ignore Windows): https://travis-ci.org/clbx/Cosmic/builds/653882093

ggerganov commented 4 years ago

It's an if statement with initializer - C++17 feature so might not be supported by older compilers.