Fixes for OSX.

edge.strict_endians
antona 2006-02-03 23:40:39 +00:00
parent 3dc68c0602
commit 4d64cb21e7
3 changed files with 38 additions and 34 deletions

View File

@ -326,13 +326,13 @@ AC_SUBST(AUTODIRS)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([ctype.h fcntl.h libintl.h limits.h locale.h mntent.h \
stddef.h stdint.h stdlib.h stdio.h stdarg.h string.h strings.h \
errno.h time.h unistd.h utime.h wchar.h getopt.h features.h endian.h \
byteswap.h sys/byteorder.h sys/endian.h sys/param.h sys/ioctl.h \
sys/mount.h sys/stat.h sys/types.h sys/vfs.h sys/statvfs.h sys/sysmacros.h \
linux/major.h linux/fd.h linux/hdreg.h machine/endian.h gcrypt.h \
windows.h gnutls/pkcs12.h])
AC_CHECK_HEADERS([ctype.h fcntl.h libgen.h libintl.h limits.h locale.h \
mntent.h stddef.h stdint.h stdlib.h stdio.h stdarg.h string.h \
strings.h errno.h time.h unistd.h utime.h wchar.h getopt.h features.h \
endian.h byteswap.h sys/byteorder.h sys/endian.h sys/param.h \
sys/ioctl.h sys/mount.h sys/stat.h sys/types.h sys/vfs.h \
sys/statvfs.h sys/sysmacros.h linux/major.h linux/fd.h linux/hdreg.h \
machine/endian.h gcrypt.h windows.h gnutls/pkcs12.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
@ -356,9 +356,9 @@ AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([atexit dup2 fdatasync getopt_long hasmntopt mbsinit memmove \
memset realpath regcomp setlocale setxattr strcasecmp strchr strdup \
strerror strnlen strtol strtoul sysconf utime])
AC_CHECK_FUNCS([atexit basename dup2 fdatasync getopt_long hasmntopt mbsinit \
memmove memset realpath regcomp setlocale setxattr strcasecmp strchr \
strdup strerror strnlen strtol strtoul sysconf utime])
# Makefiles to be created by configure.
AC_CONFIG_FILES([

View File

@ -695,7 +695,8 @@ int ntfs_device_sector_size_get(struct ntfs_device *dev)
* EOPNOTSUPP System does not support HDIO_GETGEO ioctl
* ENOTTY @dev is a file or a device not supporting HDIO_GETGEO
*/
int ntfs_device_block_size_set(struct ntfs_device *dev, int block_size)
int ntfs_device_block_size_set(struct ntfs_device *dev,
int block_size __attribute__((unused)))
{
if (!dev) {
errno = EINVAL;

View File

@ -78,6 +78,9 @@
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_LIBGEN_H
#include <libgen.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
@ -153,37 +156,37 @@ switch if you want to be able to build the NTFS utilities."
/* Page size on ia32. Can change to 8192 on Alpha. */
#define NTFS_PAGE_SIZE 4096
const char *EXEC_NAME = "mkntfs";
static char *EXEC_NAME = "mkntfs";
/**
* global variables
*/
u8 *g_buf = NULL;
int g_mft_bitmap_byte_size = 0;
u8 *g_mft_bitmap = NULL;
int g_lcn_bitmap_byte_size = 0;
u8 *g_lcn_bitmap = NULL;
runlist *g_rl_mft = NULL;
runlist *g_rl_mft_bmp = NULL;
runlist *g_rl_mftmirr = NULL;
runlist *g_rl_logfile = NULL;
runlist *g_rl_boot = NULL;
runlist *g_rl_bad = NULL;
INDEX_ALLOCATION *g_index_block = NULL;
ntfs_volume *g_vol = NULL;
int g_mft_size = 0;
long long g_mft_lcn = 0; /* lcn of $MFT, $DATA attribute */
long long g_mftmirr_lcn = 0; /* lcn of $MFTMirr, $DATA */
long long g_logfile_lcn = 0; /* lcn of $LogFile, $DATA */
int g_logfile_size = 0; /* in bytes, determined from volume_size */
long long g_mft_zone_end = 0; /* Determined from volume_size and mft_zone_multiplier, in clusters */
long long g_num_bad_blocks = 0; /* Number of bad clusters */
long long *g_bad_blocks = NULL; /* Array of bad clusters */
static u8 *g_buf = NULL;
static int g_mft_bitmap_byte_size = 0;
static u8 *g_mft_bitmap = NULL;
static int g_lcn_bitmap_byte_size = 0;
static u8 *g_lcn_bitmap = NULL;
static runlist *g_rl_mft = NULL;
static runlist *g_rl_mft_bmp = NULL;
static runlist *g_rl_mftmirr = NULL;
static runlist *g_rl_logfile = NULL;
static runlist *g_rl_boot = NULL;
static runlist *g_rl_bad = NULL;
static INDEX_ALLOCATION *g_index_block = NULL;
static ntfs_volume *g_vol = NULL;
static int g_mft_size = 0;
static long long g_mft_lcn = 0; /* lcn of $MFT, $DATA attribute */
static long long g_mftmirr_lcn = 0; /* lcn of $MFTMirr, $DATA */
static long long g_logfile_lcn = 0; /* lcn of $LogFile, $DATA */
static int g_logfile_size = 0; /* in bytes, determined from volume_size */
static long long g_mft_zone_end = 0; /* Determined from volume_size and mft_zone_multiplier, in clusters */
static long long g_num_bad_blocks = 0; /* Number of bad clusters */
static long long *g_bad_blocks = NULL; /* Array of bad clusters */
/**
* struct mkntfs_options
*/
struct mkntfs_options {
static struct mkntfs_options {
char *dev_name; /* Name of the device, or file, to use */
BOOL enable_compression; /* -C, enables compression of all files on the volume by default. */
BOOL quick_format; /* -f or -Q, fast format, don't zero the volume first. */