--- a/sem_timedwait.c
+++ b/sem_timedwait.c
@@ -185,7 +185,7 @@
 	      cleanup_args.sem = s;
 	      cleanup_args.resultPtr = &result;
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 800
 #pragma inline_depth(0)
 #endif
 	      /* Must wait */
@@ -195,7 +195,7 @@
 #endif
 	      result = pthreadCancelableTimedWait (s->sem, milliseconds);
 	      pthread_cleanup_pop(result);
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 800
 #pragma inline_depth()
 #endif