From 310ac38275a30650071bd1427465062f7e640c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bo=20Brant=C3=A9n?= Date: Tue, 21 Jan 2020 19:06:37 +0100 Subject: [PATCH] improved build compatibility --- Ext4Fsd/include/ext2fs.h | 2 ++ Ext4Fsd/include/linux/errno.h | 3 ++- Ext4Fsd/include/linux/ext3_fs.h | 2 ++ Ext4Fsd/linux.c | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Ext4Fsd/include/ext2fs.h b/Ext4Fsd/include/ext2fs.h index 5ddaf55..2830893 100644 --- a/Ext4Fsd/include/ext2fs.h +++ b/Ext4Fsd/include/ext2fs.h @@ -2527,8 +2527,10 @@ Ext2TruncateIndirect( // linux.c: linux lib implemenation // +#if _MSC_VER > 1900 int strncmp(const char* str1, const char* str2, size_t count); char* strncpy(char* dest, const char* src, size_t count); +#endif int ext2_init_linux(); diff --git a/Ext4Fsd/include/linux/errno.h b/Ext4Fsd/include/linux/errno.h index cd813dc..692ee86 100644 --- a/Ext4Fsd/include/linux/errno.h +++ b/Ext4Fsd/include/linux/errno.h @@ -140,7 +140,8 @@ #define ESERVERFAULT 526 /* An untranslatable error occurred */ #define EBADTYPE 527 /* Type not supported by server */ #define EJUKEBOX 528 /* Request initiated, but will not complete before timeout */ - +#if _MSC_VER > 1900 #define ENAMETOOLONG 1024; +#endif #endif diff --git a/Ext4Fsd/include/linux/ext3_fs.h b/Ext4Fsd/include/linux/ext3_fs.h index 157c5be..f35b954 100644 --- a/Ext4Fsd/include/linux/ext3_fs.h +++ b/Ext4Fsd/include/linux/ext3_fs.h @@ -1019,7 +1019,9 @@ struct mmp_struct { #define XATTR_NO_CTIME 0x80 #endif +#if _MSC_VER > 1900 int _strnicmp(const char* str1, const char* str2, size_t count); +#endif /* * NOTE! unlike strncmp, ext3_match returns 1 for success, 0 for failure. diff --git a/Ext4Fsd/linux.c b/Ext4Fsd/linux.c index e11dbe5..3feada0 100644 --- a/Ext4Fsd/linux.c +++ b/Ext4Fsd/linux.c @@ -983,6 +983,8 @@ void iput(struct inode *inode) // string functions from linux/lib/string.c // +#if _MSC_VER > 1900 + int _strnicmp(const char* str1, const char* str2, size_t count) { unsigned int c1, c2; @@ -1034,6 +1036,8 @@ char* strncpy(char* dest, const char* src, size_t count) return dest; } +#endif + // // initialzer and destructor //