--- a/src/gmic.cpp
+++ b/src/gmic.cpp
@@ -1850,7 +1850,9 @@ inline char *_gmic_argument_text(const char *const argument, char *const argumen
 
 // Macro for having 'get' or 'non-get' versions of G'MIC commands.
 // Set 'optim_inplace' to true, only for function implementations that act 'in-place'.
-#if gmic_pixel_type==half
+// Note: original was '#if gmic_pixel_type==half' but that uses a C++ keyword in #if
+// which MSVC rejects (C1017). Use a dedicated tag macro instead.
+#ifdef gmic_pixel_type_is_half
 #define _gmic_apply(function,optim_inplace) \
   images[uind].get_##function.move_to(images)
 #else
