linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PROBLEM: NTFS  routine fs/ntfs/unistr.c does not compile
@ 2001-08-22  6:02 Harald von Fellenberg
  2001-08-22 12:20 ` Richard Russon
  0 siblings, 1 reply; 2+ messages in thread
From: Harald von Fellenberg @ 2001-08-22  6:02 UTC (permalink / raw)
  To: aia21; +Cc: linux-ntfs-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3678 bytes --]

[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
**********************************************************

[-- Attachment #2: Card for Harald von Fellenberg --]
[-- Type: text/x-vcard, Size: 199 bytes --]

begin:vcard 
n:von Fellenberg;Harald
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:hvf@swissonline.ch
title:Senior Consultant
x-mozilla-cpt:;13344
fn:Dr. Harald von Fellenberg
end:vcard

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PROBLEM: NTFS  routine fs/ntfs/unistr.c does not compile
  2001-08-22  6:02 PROBLEM: NTFS routine fs/ntfs/unistr.c does not compile Harald von Fellenberg
@ 2001-08-22 12:20 ` Richard Russon
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Russon @ 2001-08-22 12:20 UTC (permalink / raw)
  To: Harald von Fellenberg; +Cc: aia21, linux-ntfs-dev, lkml

Hi Harald,

> [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.

Yep.

> 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

Actually all the min/max macros have (finally) been moved to kernel.h.

>      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

The correct solution is to add the following to unistr.c:

  #include <linux/kernel.h>

Cheers,
  FlatCap (Rich)
  ntfs@flatcap.org



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-22 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-22  6:02 PROBLEM: NTFS routine fs/ntfs/unistr.c does not compile Harald von Fellenberg
2001-08-22 12:20 ` Richard Russon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).