title: extract variable from macro block
body: <p>I am trying to write a function that behaves differently depending on the OS.</p>
  
  <p>I got this code somewhere in my function:</p>
  
  <pre><code>#ifdef OS_WINDOWS
      CONSOLE_SCREEN_BUFFER_INFO csbi;
      int cols;
      GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &amp;csbi);
      cols = csbi.srWindow.Right - csbi.srWindow.Left + 1;
      #else
          int cols;
          #ifdef TIOCGSIZE
          struct ttysize ts;
          ioctl(STDIN_FILENO, TIOCGSIZE, &amp;ts);
          cols = ts.ts_cols;
          #elif defined(TIOCGWINSZ)
          struct winsize ts;
          ioctl(STDIN_FILENO, TIOCGWINSZ, &amp;ts);
          cols = ts.ws_col;
          #endif // TIOCGSIZE
      #endif // OS_WINDOWS
  </code></pre>
  
  <p>So, I want to get the number of columns, but that needs to be done in two different ways for Windows and Linux... I then want to continue working with the <code>cols</code> variable. But I get <code>variable 'cols' is uninitialized when used here</code></p>
  
  <p>How can I "extract" the cols variable from the macro block?</p>