fixes for MSVC

This commit is contained in:
Josh Coalson 2001-06-07 08:06:27 +00:00
parent ac1e70aaf0
commit 3654682df9
3 changed files with 12 additions and 1 deletions

View File

@ -12,6 +12,7 @@ C_FILES= \
analyze.c \
decode.c \
encode.c \
file.c \
main.c
OBJS= $(C_FILES:.c=.obj)

View File

@ -16,8 +16,13 @@
* 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
}
}

View File

@ -21,7 +21,10 @@
#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"