summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-28 17:34:45 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-28 17:34:45 (GMT)
commita5b4a61c7cb0a655de4b0598dad1ded76d8c9c16 (patch)
tree95e09e8b7a171941c2843347fa6da5aa37e5783c
parente1ca8321ed9bac8799ad34ca064d468599b67078 (diff)
downloadCMake-a5b4a61c7cb0a655de4b0598dad1ded76d8c9c16.zip
CMake-a5b4a61c7cb0a655de4b0598dad1ded76d8c9c16.tar.gz
CMake-a5b4a61c7cb0a655de4b0598dad1ded76d8c9c16.tar.bz2
ENH: Fix building on cygwin
-rw-r--r--Utilities/cmtar/libtar.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Utilities/cmtar/libtar.c b/Utilities/cmtar/libtar.c
index b0cc2d4..7454a5c 100644
--- a/Utilities/cmtar/libtar.c
+++ b/Utilities/cmtar/libtar.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
-#ifdef _MSC_VER
+#if !defined(_WIN32) || defined(__CYGWIN__)
#include <libtar/compat.h>
#include <io.h>
#else
@@ -86,7 +86,7 @@ gzopen_frontend(char *pathname, int oflags, int mode)
if (fd == -1)
return -1;
-#ifndef _MSC_VER
+#if !defined(_WIN32) || defined(__CYGWIN__)
if ((oflags & O_CREAT) && fchmod(fd, mode))
return -1;
#endif
@@ -291,12 +291,12 @@ main(int argc, char *argv[])
int c;
int mode = 0;
libtar_list_t *l;
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
int optind;
#endif
progname = basename(argv[0]);
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
while ((c = getopt(argc, argv, "cC:gtvVxz")) != -1)
switch (c)
{