M17-Project / m17-tools

A set of M17 tools
GNU General Public License v3.0
29 stars 3 forks source link

Remove ifdefs for std::min #3

Closed argilo closed 1 year ago

argilo commented 1 year ago

The following warning appears when building m17-gateway-link_demod.cpp:

/home/argilo/git/m17-tools/apps/m17-gateway-link_demod.cpp:297:13: warning: extra tokens at end of #ifdef directive
  297 | #ifdef WIN32:
      |             ^

The #ifdef in question appears to be a workaround for the min macro defined in windows.h (https://stackoverflow.com/questions/5004858/why-is-stdmin-failing-when-windows-h-is-included), but there are better ways to work around the issue. Here I've added the template parameter to std::min instead, which should avoid the macro expansion.

Note: I have not tested this on Windows.

sp5wwp commented 1 year ago

Colon removed.

sp5wwp commented 1 year ago

Let's hope it works ;-)