From c4f158b6ffc7460b036abf233131e22a0daaf8d8 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sun, 1 Feb 2009 20:54:44 +0100 Subject: [PATCH] Fix some missing headers for cygwin --- configure.ac | 2 +- src/common.c | 3 +++ src/dir.c | 3 +++ src/file_dxf.c | 4 ++-- src/file_gz.c | 8 ++++++-- src/phrecn.c | 7 +++++++ src/ppartsel.c | 4 ---- src/win32.c | 7 ------- 8 files changed, 22 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index a8de0cae..95ccbe6d 100644 --- a/configure.ac +++ b/configure.ac @@ -248,7 +248,7 @@ AC_SYS_LARGEFILE AC_HEADER_STDC #AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h stdint.h unistd.h]) AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([byteswap.h curses.h cygwin/fs.h cygwin/version.h dal/file_dal.h dal/file.h ddk/ntddstor.h dirent.h endian.h errno.h fcntl.h features.h giconv.h glob.h iconv.h io.h libgen.h limits.h linux/fs.h linux/hdreg.h linux/types.h locale.h machine/endian.h ncurses.h ncurses/curses.h ncurses/ncurses.h ncursesw/ncurses.h ntfs/version.h openssl/md5.h openssl/opensslv.h pwd.h scsi/scsi.h scsi/scsi_ioctl.h scsi/sg.h setjmp.h signal.h stdarg.h sys/cygwin.h sys/disk.h sys/disklabel.h sys/dkio.h sys/endian.h sys/ioctl.h sys/param.h sys/select.h sys/time.h sys/utsname.h sys/vtoc.h time.h utime.h varargs.h w32api/ddk/ntdddisk.h windef.h windows.h zlib.h]) +AC_CHECK_HEADERS([byteswap.h curses.h cygwin/fs.h cygwin/version.h dal/file_dal.h dal/file.h ddk/ntddstor.h dirent.h endian.h errno.h fcntl.h features.h giconv.h glob.h iconv.h io.h libgen.h limits.h linux/fs.h linux/hdreg.h linux/types.h locale.h machine/endian.h malloc.h ncurses.h ncurses/curses.h ncurses/ncurses.h ncursesw/ncurses.h ntfs/version.h openssl/md5.h openssl/opensslv.h pwd.h scsi/scsi.h scsi/scsi_ioctl.h scsi/sg.h setjmp.h signal.h stdarg.h sys/cygwin.h sys/disk.h sys/disklabel.h sys/dkio.h sys/endian.h sys/ioctl.h sys/param.h sys/select.h sys/time.h sys/utsname.h sys/vtoc.h time.h utime.h varargs.h w32api/ddk/ntdddisk.h windef.h windows.h zlib.h]) #-------------------------------------------------------------------- # Check for iconv support (for Unicode conversion). diff --git a/src/common.c b/src/common.c index ab20166d..0fe37386 100644 --- a/src/common.c +++ b/src/common.c @@ -29,6 +29,9 @@ #ifdef HAVE_STDLIB_H #include #endif +#ifdef HAVE_MALLOC_H +#include +#endif #include #include "types.h" #include "common.h" diff --git a/src/dir.c b/src/dir.c index 92d40eae..0d398bce 100644 --- a/src/dir.c +++ b/src/dir.c @@ -40,6 +40,9 @@ #include #endif #include +#ifdef HAVE_IO_H +#include +#endif #include "common.h" #include "fat.h" #include "lang.h" diff --git a/src/file_dxf.c b/src/file_dxf.c index 556191ac..3c62503d 100644 --- a/src/file_dxf.c +++ b/src/file_dxf.c @@ -55,11 +55,11 @@ const file_hint_t file_hint_dxf= { static const unsigned char header_dxflib[10]= {'9', '9', '9', '\n', 'd', 'x', 'f', 'l', 'i', 'b'}; -static const unsigned char header_dxflib_dos[10]= {'9', '9', '9', '\r', '\n', +static const unsigned char header_dxflib_dos[11]= {'9', '9', '9', '\r', '\n', 'd', 'x', 'f', 'l', 'i', 'b'}; static const unsigned char header_dxf[11]= {' ', ' ', '0', '\n', 'S', 'E', 'C', 'T', 'I', 'O', 'N'}; -static const unsigned char header_dxf_dos[11]= {' ', ' ', '0', '\r', '\n', +static const unsigned char header_dxf_dos[12]= {' ', ' ', '0', '\r', '\n', 'S', 'E', 'C', 'T', 'I', 'O', 'N'}; static void register_header_check_dxf(file_stat_t *file_stat) diff --git a/src/file_gz.c b/src/file_gz.c index a4155f36..67993370 100644 --- a/src/file_gz.c +++ b/src/file_gz.c @@ -96,11 +96,15 @@ static int header_check_gz(const unsigned char *buffer, const unsigned int buffe } if((flags&GZ_FNAME)!=0) { - while(off #endif #include +#ifdef HAVE_WINDEF_H +#include +#endif +#ifdef HAVE_WINBASE_H +#include +#include +#endif #include "fnctdsk.h" #include "dir.h" #include "fat_dir.h" diff --git a/src/ppartsel.c b/src/ppartsel.c index 672b0c2a..48cb12d6 100644 --- a/src/ppartsel.c +++ b/src/ppartsel.c @@ -33,11 +33,7 @@ #include "types.h" #include "common.h" #include "intrf.h" -#ifdef HAVE_NCURSES -#include "intrfn.h" -#else #include -#endif #include "fnctdsk.h" #include "dir.h" #include "list.h" diff --git a/src/win32.c b/src/win32.c index 21f8ece1..5275de23 100644 --- a/src/win32.c +++ b/src/win32.c @@ -38,13 +38,6 @@ #include #endif #include /* isspace */ -#ifdef HAVE_WINDEF_H -#include -#endif -#ifdef HAVE_WINBASE_H -#include -#include -#endif #ifdef HAVE_WINIOCTL_H #include #endif