From aa247f5101573de49686cb05d40f2852b62c881f Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Mon, 6 Oct 2003 11:38:25 +0000 Subject: [PATCH] Make it work on Cygwin. (Logical change 1.188) --- include/endians.h | 24 +++++++++++++++++++++++- include/volume.h | 7 +++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/include/endians.h b/include/endians.h index a3bf6790..30eaee76 100644 --- a/include/endians.h +++ b/include/endians.h @@ -2,7 +2,7 @@ * endians.h - Definitions related to handling of byte ordering. Part of the * Linux-NTFS project. * - * Copyright (c) 2000-2002 Anton Altaparmakov + * Copyright (c) 2000-2003 Anton Altaparmakov * * This program/include file is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -35,6 +35,28 @@ #include +/* The following are not defined on Cygwin... Luckily Cygwin is LE already. */ +#ifdef __CYGWIN32__ + +#define __le16_to_cpu(x) (x) +#define __le32_to_cpu(x) (x) +#define __le64_to_cpu(x) (x) + +#define __cpu_to_le16(x) (x) +#define __cpu_to_le32(x) (x) +#define __cpu_to_le64(x) (x) + +#define __constant_le16_to_cpu(x) (x) +#define __constant_le32_to_cpu(x) (x) +#define __constant_le64_to_cpu(x) (x) + +#define __constant_cpu_to_le16(x) (x) +#define __constant_cpu_to_le32(x) (x) +#define __constant_cpu_to_le64(x) (x) + +#endif /* __CYGWIN32__ */ + + /* Unsigned from LE to CPU conversion. */ #define le16_to_cpu(x) (u16)__le16_to_cpu((u16)(x)) diff --git a/include/volume.h b/include/volume.h index ce9684c2..0ef8ee63 100644 --- a/include/volume.h +++ b/include/volume.h @@ -30,6 +30,13 @@ # include #endif +/* Cygwin doesn't seem to have MS_RDONLY, so we define it here. */ +#if defined(__CYGWIN32__) && !defined(MS_RDONLY) +typedef enum { + MS_RDONLY = 1, +} MS_MOUNT; +#endif + /* Forward declaration */ typedef struct _ntfs_volume ntfs_volume;