PROBLEM: NTFS routine fs/ntfs/unistr.c does not compile

From: Harald von Fellenberg (harald.von-fellenberg@sun.com)
Date: Wed Aug 22 2001 - 01:02:05 EST


[1.] NTFS routine fs/ntfs/unistr.c does not compile
[2.] NTFS routine fs/ntfs/unistr.c does not compile: the macro
min(a,b,c)
     is not defined. Comparison with Linux 2.4.7 revealed that
     1. the pertaining line in unistr.c has changed from 2.4.7 to 2.4.9
     2. the macro definition in file fs/ntfs/macros.h for macro min()
has
        been dropped
     The solution was straight forward: add the (three-parameter) macro
     definition from include/linux/kernel.h to fs/ntfs/macros.h
     The patch is added below
[3.] Keywords filesystem, NTFS
[4.] Kernel version 2.4.9
[5.] (none)
[6.] Compilation output for ``make bzImage´´

make[3]: Entering directory `/usr/src/linux-2.4.9/fs/ntfs'
(...)
gcc -D__KERNEL__ -I/usr/src/linux-2.4.9/include -Wall
-Wstrict-prototypes -Wno-t
rigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe
-mprefe
rred-stack-boundary=2 -march=i686 -DNTFS_VERSION=\"1.1.16\" -c -o
unistr.o un
istr.c
unistr.c: In function `ntfs_collate_names':
unistr.c:99: warning: implicit declaration of function `min'
unistr.c:99: parse error before `unsigned'
unistr.c:99: parse error before `)'
unistr.c:97: warning: `c1' might be used uninitialized in this function
unistr.c: At top level:
unistr.c:118: parse error before `if'
unistr.c:123: warning: type defaults to `int' in declaration of `c1'
unistr.c:123: `name1' undeclared here (not in a function)
unistr.c:123: warning: data definition has no type or storage class
unistr.c:124: parse error before `if'
make[3]: *** [unistr.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.9/fs/ntfs'

[7.] Environment
[7.1.] Software (add the output of the ver_linux script here)
If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.

Linux harald 2.4.9 #6 Tue Aug 21 17:14:32 CEST 2001 i686 unknown

Gnu C 2.95.2
Gnu make 3.79.1
binutils 2.10.0.33
util-linux 2.10q
mount 2.11g
modutils 2.4.1
e2fsprogs 1.19
pcmcia-cs 3.1.22
PPP 2.4.0
isdn4k-utils 3.1pre1a
Linux C Library x 1 root root 1382179 Jan 19 2001
/lib/libc.so.6
Dynamic linker (ldd) 2.2
Procps 2.0.7
Net-tools 1.57
Kbd 1.02
Sh-utils 2.0
Modules Loaded

[X.] The patch is here:

--- linux-2.4.9/fs/ntfs/macros.h.orig Wed Aug 15 10:22:17 2001
+++ linux-2.4.9/fs/ntfs/macros.h Tue Aug 21 17:09:11 2001
@@ -11,6 +11,14 @@
 #define NTFS_INO2VOL(ino) (&((ino)->i_sb->u.ntfs_sb))
 #define NTFS_LINO2NINO(ino) (&((ino)->u.ntfs_i))

+/* Three parameter min and max macros taken from include/linux/kernel.h
*/
+#ifndef min
+#define min(type,x,y) \
+ ({ type __x = (x), __y = (y); __x < __y ? __x: __y; })
+#define max(type,x,y) \
+ ({ type __x = (x), __y = (y); __x > __y ? __x: __y; })
+#endif
+
 #define IS_MAGIC(a,b) (*(int*)(a) == *(int*)(b))
 #define IS_MFT_RECORD(a) IS_MAGIC((a),"FILE")
 #define IS_INDEX_RECORD(a) IS_MAGIC((a),"INDX")

Please redspond directly, I am not on the aiases
Thanks,

Harald

-- 
**********************************************************
 Dr. Harald von Fellenberg  
 Senior Consultant          Technology Strategy Office
 Tel:    ++41 1 908 9230    Sun Microsystems (Schweiz) AG
 Fax:    ++41 1 908 9001    Javastr. 2 
 Mobile: ++41 79 349 0393   CH-8604 Volketswil
 mailto:harald.von-fellenberg@sun.com
**********************************************************


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 23 2001 - 21:00:47 EST