Index: example/cdchange.c =================================================================== --- example/cdchange.c +++ example/cdchange.c @@ -73,7 +73,11 @@ printf("Giving you %lu seconds to change CD if you want to do so.\n", i_sleep); +#ifndef __MINGW32__ sleep(30); +#else + _sleep(30 * 1000); +#endif if (cdio_get_media_changed(p_cdio)) printf("Media status: changed\n"); else Index: lib/iso9660/xa.c =================================================================== --- lib/iso9660/xa.c +++ lib/iso9660/xa.c @@ -163,11 +163,19 @@ if (i_perms & XA_PERM_RUSR) mode |= S_IRUSR; if (i_perms & XA_PERM_XUSR) mode |= S_IXUSR; +#ifdef S_IRGRP if (i_perms & XA_PERM_RGRP) mode |= S_IRGRP; +#endif +#ifdef S_IRGRP if (i_perms & XA_PERM_XGRP) mode |= S_IXGRP; +#endif +#ifdef S_IRGRP if (i_perms & XA_PERM_ROTH) mode |= S_IROTH; +#endif +#ifdef S_IRGRP if (i_perms & XA_PERM_XOTH) mode |= S_IXOTH; +#endif if (i_perms & XA_ATTR_DIRECTORY) mode |= S_IFDIR; Index: lib/driver/gnu_linux.c =================================================================== --- lib/driver/gnu_linux.c +++ lib/driver/gnu_linux.c @@ -33,7 +33,9 @@ #include #include #include +#ifndef __MINGW32__ #include +#endif #include #include Index: lib/udf/udf.c =================================================================== --- lib/udf/udf.c +++ lib/udf/udf.c @@ -64,13 +64,25 @@ if (i_perms & FE_PERM_U_WRITE) mode |= S_IWUSR; if (i_perms & FE_PERM_U_EXEC) mode |= S_IXUSR; +#ifdef S_IRGRP if (i_perms & FE_PERM_G_READ) mode |= S_IRGRP; +#endif +#ifdef S_IWGRP if (i_perms & FE_PERM_G_WRITE) mode |= S_IWGRP; +#endif +#ifdef S_IXGRP if (i_perms & FE_PERM_G_EXEC) mode |= S_IXGRP; +#endif +#ifdef S_IROTH if (i_perms & FE_PERM_O_READ) mode |= S_IROTH; +#endif +#ifdef S_IWOTH if (i_perms & FE_PERM_O_WRITE) mode |= S_IWOTH; +#endif +#ifdef S_IXOTH if (i_perms & FE_PERM_O_EXEC) mode |= S_IXOTH; +#endif switch (udf_fe.icb_tag.file_type) { case ICBTAG_FILE_TYPE_DIRECTORY: @@ -79,24 +91,34 @@ case ICBTAG_FILE_TYPE_REGULAR: mode |= S_IFREG; break; +#ifdef S_IFLNK case ICBTAG_FILE_TYPE_SYMLINK: mode |= S_IFLNK; break; +#endif case ICBTAG_FILE_TYPE_CHAR: mode |= S_IFCHR; break; +#ifdef S_IFSOCK case ICBTAG_FILE_TYPE_SOCKET: mode |= S_IFSOCK; break; +#endif case ICBTAG_FILE_TYPE_BLOCK: mode |= S_IFBLK; break; default: ; }; +#ifdef S_ISUID if (i_flags & ICBTAG_FLAG_SETUID) mode |= S_ISUID; +#endif +#ifdef S_ISGID if (i_flags & ICBTAG_FLAG_SETGID) mode |= S_ISGID; +#endif +#ifdef S_ISVTX if (i_flags & ICBTAG_FLAG_STICKY) mode |= S_ISVTX; +#endif } return mode; Index: lib/udf/udf_time.c =================================================================== --- lib/udf/udf_time.c +++ lib/udf/udf_time.c @@ -104,8 +104,12 @@ }; #ifdef HAVE_TIMEZONE_VAR +#ifdef MINGW32 +__MINGW_IMPORT long timezone; +#else extern long timezone; #endif +#endif time_t * udf_stamp_to_time(time_t *dest, long int *dest_usec, Index: include/cdio/udf_time.h =================================================================== --- include/cdio/udf_time.h +++ include/cdio/udf_time.h @@ -28,6 +28,13 @@ #define UDF_TIME_H #include +#if (__MINGW32__ && !HAVE_STRUCT_TIMESPEC) +#define HAVE_STRUCT_TIMESPEC +struct timespec { + long tv_sec; + long tv_nsec; +}; +#endif #ifdef __cplusplus extern "C" {