fixes for MSVC
authorJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 7 Jun 2001 08:06:27 +0000 (08:06 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 7 Jun 2001 08:06:27 +0000 (08:06 +0000)
src/flac/Makefile.vc
src/flac/file.c
src/flac/main.c

index 014e37a..68d9710 100644 (file)
@@ -12,6 +12,7 @@ C_FILES= \
        analyze.c \\r
        decode.c \\r
        encode.c \\r
+       file.c \\r
        main.c\r
 \r
 OBJS= $(C_FILES:.c=.obj)\r
index bf23bd3..8727414 100644 (file)
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#include <unistd.h> /* for chown() */
+#ifdef _MSC_VER
+#include <sys/utime.h> /* for utime() */
+#include <io.h> /* for chmod() */
+#else
 #include <utime.h> /* for utime() */
+#include <unistd.h> /* for chown() */
+#endif
 #include <sys/stat.h> /* for stat() */
 #include "file.h"
 
@@ -31,7 +36,9 @@ void flac__file_copy_metadata(const char *srcpath, const char *destpath)
                srctime.modtime = srcstat.st_mtime;
                (void)chmod(destpath, srcstat.st_mode);
                (void)utime(destpath, &srctime);
+#ifndef _MSC_VER
                (void)chown(destpath, srcstat.st_uid, -1);
                (void)chown(destpath, -1, srcstat.st_gid);
+#endif
        }
 }
index aa170a2..b9bd0c1 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifndef _MSC_VER
+/* unlink is in stdio.h in VC++ */
 #include <unistd.h> /* for unlink() */
+#endif
 #include "FLAC/all.h"
 #include "analyze.h"
 #include "decode.h"