diff --git a/modules/access/dshow/common.h b/modules/access/dshow/common.h
index e0d74b585f33842718bd6eebf3c68b072bcb65e4..8a601619d7df997295dc4d0123a5e2b8cc28e716 100644
--- a/modules/access/dshow/common.h
+++ b/modules/access/dshow/common.h
@@ -24,8 +24,12 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef size_t
 #undef size_t
+#endif
+#ifdef ptrdiff_t
 #undef ptrdiff_t
+#endif
 #include <string>
 #include <list>
 #include <deque>