From fd3ea089c1ea499799dc21b1d467d266bd793034 Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Tue, 11 Jul 2017 14:20:56 -0700 Subject: [PATCH] Fix minor portability issues in halide_image_io.h -- Add explicit #include of HalideRuntime.h -- avoid !"string-literal" as some compilers will complain about coercion-to-bool --- tools/halide_image_io.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/halide_image_io.h b/tools/halide_image_io.h index 4e8d08a00569..80c990792d3f 100644 --- a/tools/halide_image_io.h +++ b/tools/halide_image_io.h @@ -22,6 +22,8 @@ #include "jpeglib.h" #endif +#include "HalideRuntime.h" // for halide_type_t + namespace Halide { namespace Tools { @@ -923,7 +925,7 @@ struct ImageTypeConversion { case Internal::halide_type_code(halide_type_uint, 64): return convert_image(src.template as()); default: - assert(!"Unsupported type"); + assert(false && "Unsupported type"); using DstImageType = typename Internal::ImageTypeWithElemType::type; return DstImageType(); } @@ -968,7 +970,7 @@ struct ImageTypeConversion { case Internal::halide_type_code(halide_type_uint, 64): return convert_image(src); default: - assert(!"Unsupported type"); + assert(false && "Unsupported type"); return ImageType(); } } @@ -1015,7 +1017,7 @@ struct ImageTypeConversion { case Internal::halide_type_code(halide_type_uint, 64): return convert_image(src.template as(), dst_type); default: - assert(!"Unsupported type"); + assert(false && "Unsupported type"); return ImageType(); } }