<p>Ah, okay, now I understand better. The first patch was written on a plane waiting to take off so I'm not too surprised it didn't work perfectly. :)</p>

<p>I've taken a closer look at the situation and committed <a href="https://github.com/mlpack/mlpack/commit/8bd3f964748695df1023ea6a74b9e5d4bae75eb4" class="commit-link"><tt>8bd3f96</tt></a>. This removes the undef'ing of min/max entirely and sets <code>NOMINMAX</code> safely before including <code>windows.h</code>, like you suggested. Can you try it and see if that fixes the issue? Thanks for testing the previous patch, also.</p>

<p>I don't see a quick way to move the inclusion of the system-dependent headers into timers.cpp, since the Timers class exposes some methods and has some members that require a definition of the <code>timeval</code> type. If you'd like to refactor and submit a pull request, I'm happy to go that direction, but I'm also happy enough to leave it as-is.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/422#issuecomment-84020664">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFO1yIToxjBdEt6zgplHyqRqDHJIFks5n3B0jgaJpZM4Dx1eJ.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/422#issuecomment-84020664"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>