diff --git a/programs/cabarc/cabarc.c b/programs/cabarc/cabarc.c
index bef4bfc8da47401cea0a8ec2a43cba496b59569a..02213f63c51e46eb2af26455b6b3e05105be96dc 100644
--- a/programs/cabarc/cabarc.c
+++ b/programs/cabarc/cabarc.c
@@ -35,6 +35,7 @@
 WINE_DEFAULT_DEBUG_CHANNEL(cabarc);
 
 /* from msvcrt */
+#ifndef _O_RDONLY
 #define _O_RDONLY      0
 #define _O_WRONLY      1
 #define _O_RDWR        2
@@ -50,17 +51,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(cabarc);
 #define _O_SHORT_LIVED 0x1000
 #define _O_TEXT        0x4000
 #define _O_BINARY      0x8000
+#endif
 
+#ifndef _SH_COMPAT
 #define _SH_COMPAT     0x00
 #define _SH_DENYRW     0x10
 #define _SH_DENYWR     0x20
 #define _SH_DENYRD     0x30
 #define _SH_DENYNO     0x40
+#endif
 
+#ifndef _A_RDONLY
 #define _A_RDONLY      0x01
 #define _A_HIDDEN      0x02
 #define _A_SYSTEM      0x04
 #define _A_ARCH        0x20
+#endif
 
 /* command-line options */
 static int opt_cabinet_size = CB_MAX_DISK;