diff --git a/MSVC/README b/MSVC/README index 42884a96..032b7041 100644 --- a/MSVC/README +++ b/MSVC/README @@ -1,4 +1,9 @@ Files in this directory are for compiling with Microsoft Visual C. -They are courtesy of John Oseman (mog). +They are courtesy of John Oseman (mog) and Pete Batard . -$Id: README,v 1.1 2004/10/30 14:18:17 rocky Exp $ +The extract, driver, iso9660 and udf projects require Visual Studio 2010 +or later. + +To compile your own project, you will probably need to add the missing/ +directory to your include path, as it provides stdint.h, inttypes.h and +unistd.h that provide some of the missing types required by libcdio. diff --git a/lib/driver/MSWindows/win32_ioctl.c b/lib/driver/MSWindows/win32_ioctl.c index 3e215f81..6e95cf5c 100755 --- a/lib/driver/MSWindows/win32_ioctl.c +++ b/lib/driver/MSWindows/win32_ioctl.c @@ -31,12 +31,19 @@ # include "NtScsi.h" # include "undocumented.h" #else +#if defined (__MINGW64__) +# define _NTSRB_ /* Bad things happen if srb.h gets included */ +# include +# include +# include +#else # include # include +#endif # include #endif -#ifdef WIN32 +#if defined (_WIN32) #include #endif diff --git a/lib/driver/realpath.c b/lib/driver/realpath.c index 79804b55..b83a9936 100644 --- a/lib/driver/realpath.c +++ b/lib/driver/realpath.c @@ -46,7 +46,7 @@ # include #endif -#ifdef HAVE_UNISTD_H // readlink +#ifdef HAVE_UNISTD_H /* readlink */ # include #endif diff --git a/lib/driver/sector.c b/lib/driver/sector.c index 00a4db10..930b8b21 100644 --- a/lib/driver/sector.c +++ b/lib/driver/sector.c @@ -28,7 +28,9 @@ #include "cdio_assert.h" #include "portable.h" +#ifdef HAVE_STDIO_H #include +#endif #ifdef HAVE_STRING_H #include #endif diff --git a/lib/driver/util.c b/lib/driver/util.c index 1e4cb6c0..d2a295f6 100644 --- a/lib/driver/util.c +++ b/lib/driver/util.c @@ -26,7 +26,9 @@ #ifdef HAVE_STDLIB_H #include #endif +#ifdef HAVE_STDIO_H #include +#endif #ifdef HAVE_STRING_H #include diff --git a/lib/iso9660/Makefile.am b/lib/iso9660/Makefile.am index ed3f5479..8254aeb0 100644 --- a/lib/iso9660/Makefile.am +++ b/lib/iso9660/Makefile.am @@ -1,6 +1,4 @@ -# $Id: Makefile.am,v 1.18 2008/10/20 01:25:15 rocky Exp $ -# -# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 +# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2012 # Rocky Bernstein # # This program is free software: you can redistribute it and/or modify @@ -135,13 +133,13 @@ libiso9660_la_LDFLAGS = $(libiso9660_la_ldflags) -Wl,--version-script=libiso9660 libiso9660_la_DEPENDENCIES = $(libcdio9660_la_dependencies) libiso9660.la.ver libiso9660.la.ver: $(libiso9660_la_OBJECTS) $(srcdir)/libiso9660.sym - echo 'ISO9660_$(libiso9660_la_MAJOR) {' > $@ - objs=`for obj in $(libiso9660_la_OBJECTS); do sed -ne "s/^pic_object='\(.*\)'$$/\1/p" $$obj; done`; + @echo 'ISO9660_$(libiso9660_la_MAJOR) {' > $@ + @objs=`for obj in $(libiso9660_la_OBJECTS); do sed -ne "s/^pic_object='\(.*\)'$$/\1/p" $$obj; done`; \ if test -n "$$objs" ; then \ nm $${objs} | sed -n -e 's/^.*[ ][ABCDGIRSTW][ABCDGIRSTW]*[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/\1/p' | sort -u | { first=true; while read symbol; do if grep -q "^$${symbol}\$$" $(srcdir)/libiso9660.sym; then if test $$first = true; then echo " global:"; first=false; fi; echo " $${symbol};"; fi; done; } >> $@; \ nm $${objs} | sed -n -e 's/^.*[ ][ABCDGIRSTW][ABCDGIRSTW]*[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/\1/p' | sort -u | { first=true; while read symbol; do if grep -q "^$${symbol}\$$" $(srcdir)/libiso9660.sym; then :; else if test $$first = true; then echo " local:"; first=false; fi; echo " $${symbol};"; fi; done; } >> $@; \ fi - echo '};' >> $@ + @echo '};' >> $@ MOSTLYCLEANFILES = libiso9660.la.ver else diff --git a/lib/iso9660/rock.c b/lib/iso9660/rock.c index 19238634..f83825fd 100644 --- a/lib/iso9660/rock.c +++ b/lib/iso9660/rock.c @@ -34,16 +34,10 @@ # include #endif -#ifndef HAVE_S_ISLNK -# define S_ISLNK(s) ((void)s,0) -#endif -#ifndef HAVE_S_ISSOCK -# define S_ISSOCK(s) ((void)s,0) -#endif - #include #include #include +#include "filemode.h" #define CDIO_MKDEV(ma,mi) ((ma)<<16 | (mi)) @@ -112,7 +106,7 @@ realloc_symlink(/*in/out*/ iso9660_stat_t *p_stat, uint8_t i_grow) #define SETUP_ROCK_RIDGE(DE,CHR,LEN) \ { \ - LEN= sizeof(iso9660_dir_t) + DE->filename_len; \ + LEN= sizeof(iso9660_dir_t) + DE->filename.len; \ if(LEN & 1) LEN++; \ CHR = ((unsigned char *) DE) + LEN; \ LEN = *((unsigned char *) DE) - LEN; \ @@ -185,10 +179,10 @@ get_rock_ridge_filename(iso9660_dir_t * p_iso9660_dir, break; case SIG('C','E'): { - iso711_t i_fname = from_711(p_iso9660_dir->filename_len); - if ('\0' == p_iso9660_dir->filename[0] && 1 == i_fname) + iso711_t i_fname = from_711(p_iso9660_dir->filename.len); + if ('\0' == p_iso9660_dir->filename.str[1] && 1 == i_fname) break; - if ('\1' == p_iso9660_dir->filename[0] && 1 == i_fname) + if ('\1' == p_iso9660_dir->filename.str[1] && 1 == i_fname) break; } CHECK_CE; @@ -465,7 +459,7 @@ parse_rock_ridge_stat_internal(iso9660_dir_t *p_iso9660_dir, case SIG('R','E'): cdio_warn("Attempt to read p_stat for relocated directory"); goto out; -#if FINISHED +#ifdef FINISHED case SIG('C','L'): { iso9660_stat_t * reloc; diff --git a/lib/iso9660/xa.c b/lib/iso9660/xa.c index 78990cdf..9af5a09d 100644 --- a/lib/iso9660/xa.c +++ b/lib/iso9660/xa.c @@ -43,6 +43,7 @@ const char ISO_XA_MARKER_STRING[] = {'C', 'D', '-', 'X', 'A', '0', '0', '1'}; /* Private headers */ #include "cdio_assert.h" +#include "filemode.h" /** The below variable is trickery to force enum symbol values to be recorded in debug symbol tables. It is used to allow one to refer diff --git a/lib/udf/filemode.c b/lib/udf/filemode.c index 8893ac54..de6a6215 100644 --- a/lib/udf/filemode.c +++ b/lib/udf/filemode.c @@ -1,7 +1,7 @@ /* filemode.c -- make a string describing file modes - Copyright (C) 2005, 2008, 2011 Rocky Bernstein + Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -28,98 +28,7 @@ #endif #include - -#if !S_IRUSR -# if S_IREAD -# define S_IRUSR S_IREAD -# else -# define S_IRUSR 00400 -# endif -#endif - -#if !S_IWUSR -# if S_IWRITE -# define S_IWUSR S_IWRITE -# else -# define S_IWUSR 00200 -# endif -#endif - -#if !S_IXUSR -# if S_IEXEC -# define S_IXUSR S_IEXEC -# else -# define S_IXUSR 00100 -# endif -#endif - -#if !S_IRGRP -# define S_IRGRP (S_IRUSR >> 3) -#endif -#if !S_IWGRP -# define S_IWGRP (S_IWUSR >> 3) -#endif -#if !S_IXGRP -# define S_IXGRP (S_IXUSR >> 3) -#endif -#if !S_IROTH -# define S_IROTH (S_IRUSR >> 6) -#endif -#if !S_IWOTH -# define S_IWOTH (S_IWUSR >> 6) -#endif -#if !S_IXOTH -# define S_IXOTH (S_IXUSR >> 6) -#endif - -#ifdef STAT_MACROS_BROKEN -# undef S_ISBLK -# undef S_ISCHR -# undef S_ISDIR -# undef S_ISFIFO -# undef S_ISLNK -# undef S_ISMPB -# undef S_ISMPC -# undef S_ISNWK -# undef S_ISREG -# undef S_ISSOCK -#endif /* STAT_MACROS_BROKEN. */ - -#if !defined S_ISBLK && defined S_IFBLK -# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -#endif -#if !defined S_ISCHR && defined S_IFCHR -# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -#endif -#if !defined S_ISDIR && defined S_IFDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif -#if !defined S_ISREG && defined S_IFREG -# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif -#if !defined S_ISFIFO && defined S_IFIFO -# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) -#endif -#if !defined S_ISLNK && defined S_IFLNK -# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -#endif -#if !defined S_ISSOCK && defined S_IFSOCK -# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) -#endif -#if !defined S_ISMPB && defined S_IFMPB /* V7 */ -# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) -# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) -#endif -#if !defined S_ISNWK && defined S_IFNWK /* HP/UX */ -# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) -#endif -#if !defined S_ISDOOR && defined S_IFDOOR /* Solaris 2.5 and up */ -# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR) -#endif -#if !defined S_ISCTG && defined S_IFCTG /* MassComp */ -# define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG) -#endif - +#include "filemode.h" /* Set the 's' and 't' flags in file attributes string CHARS, diff --git a/lib/udf/udf_private.h b/lib/udf/udf_private.h index 92b16687..559b1d48 100644 --- a/lib/udf/udf_private.h +++ b/lib/udf/udf_private.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2005, 2006, 2008, 2011 Rocky Bernstein + Copyright (C) 2005, 2006, 2008, 2011, 2012 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,13 +31,12 @@ /* Implementation of opaque types */ struct udf_s { - bool b_stream; /* Use stream pointer, else use - p_cdio. */ - ssize_t i_position; /* Position in file if positive. */ - CdioDataSource_t *stream; /* Stream pointer if stream */ - CdIo_t *cdio; /* Cdio pointer if read device */ + bool b_stream; /* Use stream pointer, else use p_cdio */ + off_t i_position; /* Position in file if positive */ + CdioDataSource_t *stream; /* Stream pointer if stream */ + CdIo_t *cdio; /* Cdio pointer if read device */ anchor_vol_desc_ptr_t anchor_vol_desc_ptr; - uint32_t pvd_lba; /* sector of Primary Volume Descriptor */ + uint32_t pvd_lba; /* sector of Primary Volume Descriptor */ partition_num_t i_partition; /* partition number */ uint32_t i_part_start; /* start of Partition Descriptor */ uint32_t lvd_lba; /* sector of Logical Volume Descriptor */ diff --git a/src/getopt.h b/src/getopt.h index fb30719a..c40f6543 100644 --- a/src/getopt.h +++ b/src/getopt.h @@ -99,7 +99,7 @@ struct option #define optional_argument 2 #if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ +#if defined (__GNU_LIBRARY__) || defined (__MINGW32__) /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ diff --git a/src/iso-info.c b/src/iso-info.c index a3171116..b4c04b95 100644 --- a/src/iso-info.c +++ b/src/iso-info.c @@ -1,7 +1,5 @@ /* - $Id: iso-info.c,v 1.40 2008/06/19 15:44:16 flameeyes Exp $ - - Copyright (C) 2004, 2005, 2006, 2008 Rocky Bernstein + Copyright (C) 2004, 2005, 2006, 2008, 2012 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,21 +30,26 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #include #include #include #include +#ifdef HAVE_STDIO_H #include +#endif +#ifdef HAVE_ERRNO_H #include +#endif +#ifdef HAVE_STRING_H #include +#endif #ifdef HAVE_UNISTD_H #include #endif -#include - -#include #if 0 #define STRONG "\033[1m" diff --git a/src/iso-read.c b/src/iso-read.c index 820fee32..4820887d 100644 --- a/src/iso-read.c +++ b/src/iso-read.c @@ -23,12 +23,15 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #include #include +#ifdef HAVE_STDIO_H #include - +#endif #ifdef HAVE_ERRNO_H #include #endif @@ -38,9 +41,6 @@ #ifdef HAVE_UNISTD_H #include #endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif #include "getopt.h" diff --git a/src/mmc-tool.c b/src/mmc-tool.c index 45042096..77fb67c6 100644 --- a/src/mmc-tool.c +++ b/src/mmc-tool.c @@ -17,11 +17,12 @@ /* A program to using the MMC interface to list CD and drive features from the MMC GET_CONFIGURATION command . */ -#ifdef HAVE_CONFIG_H -# include "config.h" -# define __CDIO_CONFIG_H__ 1 -#endif + +#include "util.h" + +#ifdef HAVE_STDIO_H #include +#endif #ifdef HAVE_SYS_TYPES_H #include #endif @@ -34,7 +35,6 @@ #include #include #include -#include "util.h" #include "getopt.h" static void