diff --git a/magick/resource.c b/magick/resource.c
index 39eb8f1..d21247d 100644
--- a/magick/resource.c
+++ b/magick/resource.c
@@ -365,7 +365,7 @@
     directory=GetPolicyValue("temporary-path");
   if (directory == (char *) NULL)
     directory=GetEnvironmentValue("TMPDIR");
-#if defined(__WINDOWS__) || defined(__OS2__)
+#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__OS2__)
   if (directory == (char *) NULL)
     directory=GetEnvironmentValue("TMP");
   if (directory == (char *) NULL)