diff --git a/magick/attribute.c b/magick/attribute.c
index 7fa5b49..723bfc3 100644
--- a/magick/attribute.c
+++ b/magick/attribute.c
@@ -190,7 +190,7 @@
if (status == MagickFalse)
continue;
-#if defined(HAVEMAGICKCORE_OPENMP_SUPPORT)
+#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
# pragma omp critical (MagickCore_GetImageBoundingBox)
#endif
bounding_box=bounds;
@@ -219,7 +219,7 @@
bounding_box.height=(unsigned long) y;
p++;
}
-#if defined(HAVEMAGICKCORE_OPENMP_SUPPORT)
+#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
# pragma omp critical (MagickCore_GetImageBoundingBox)
#endif
{