Skip to content

Commit 59ed94e

Browse files
committed
nominmax for windows
1 parent 6e77560 commit 59ed94e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/viam/examples/mlmodel/example_audio_classification_client.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#ifdef _WIN32
16+
#define NOMINMAX
17+
#endif
18+
1519
#include <chrono>
1620
#include <cstdlib>
1721
#include <fstream>
@@ -377,7 +381,7 @@ int main(int argc, char* argv[]) try {
377381
});
378382

379383
// Print out the top 5 (or fewer) label/score pairs.
380-
for (size_t i = 0; i != 5UL && i != scored_labels.size(); ++i) {
384+
for (size_t i = 0; i != std::min(5UL, scored_labels.size()); ++i) {
381385
// TODO: Avoid hardcoding the width here.
382386
VIAM_SDK_LOG(info) << boost::format("%1%: %2% %|40t|%3%\n") % i %
383387
*scored_labels[i].label % scored_labels[i].score;

0 commit comments

Comments
 (0)