* [PATCH] 2.5.51 ntfs - GCC3
@ 2002-12-10 7:51 Justin Pryzby
2002-12-10 10:12 ` [Linux-NTFS-Dev] " Anton Altaparmakov
0 siblings, 1 reply; 2+ messages in thread
From: Justin Pryzby @ 2002-12-10 7:51 UTC (permalink / raw)
To: linux-kernel, linux-ntfs-dev, pryzju01
[-- Attachment #1: Type: text/plain, Size: 755 bytes --]
Trivial patch for GCC3.
What was going on with 2.96<=__GNUC__<3 ?!
Justin
diff -Naur linux-2.5.51.org/fs/ntfs/types.h linux-2.5.51.ntfs/fs/ntfs/types.h
--- linux-2.5.51.org/fs/ntfs/types.h 2002-12-10 02:17:52.000000000 -0500
+++ linux-2.5.51.ntfs/fs/ntfs/types.h 2002-12-10 02:41:31.000000000 -0500
@@ -23,12 +23,12 @@
#ifndef _LINUX_NTFS_TYPES_H
#define _LINUX_NTFS_TYPES_H
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
-#define SN(X) X /* Struct Name */
-#define SC(P,N) P.N /* ShortCut: Prefix, Name */
-#else
+#if __GNUC__ == 2 && __GNUC_MINOR__ >= 96
#define SN(X)
#define SC(P,N) N
+#else
+#define SN(X) X /* Struct Name */
+#define SC(P,N) P.N /* ShortCut: Prefix, Name */
#endif
/* 2-byte Unicode character type. */
[-- Attachment #2: Patch for Linux 2.5.51 ntfs with gcc3 --]
[-- Type: text/plain, Size: 678 bytes --]
diff -Naur linux-2.5.51.org/fs/ntfs/types.h linux-2.5.51.ntfs/fs/ntfs/types.h
--- linux-2.5.51.org/fs/ntfs/types.h 2002-12-10 02:17:52.000000000 -0500
+++ linux-2.5.51.ntfs/fs/ntfs/types.h 2002-12-10 02:41:31.000000000 -0500
@@ -23,12 +23,12 @@
#ifndef _LINUX_NTFS_TYPES_H
#define _LINUX_NTFS_TYPES_H
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
-#define SN(X) X /* Struct Name */
-#define SC(P,N) P.N /* ShortCut: Prefix, Name */
-#else
+#if __GNUC__ == 2 && __GNUC_MINOR__ >= 96
#define SN(X)
#define SC(P,N) N
+#else
+#define SN(X) X /* Struct Name */
+#define SC(P,N) P.N /* ShortCut: Prefix, Name */
#endif
/* 2-byte Unicode character type. */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Linux-NTFS-Dev] [PATCH] 2.5.51 ntfs - GCC3
2002-12-10 7:51 [PATCH] 2.5.51 ntfs - GCC3 Justin Pryzby
@ 2002-12-10 10:12 ` Anton Altaparmakov
0 siblings, 0 replies; 2+ messages in thread
From: Anton Altaparmakov @ 2002-12-10 10:12 UTC (permalink / raw)
To: Justin Pryzby; +Cc: linux-kernel, linux-ntfs-dev, pryzju01
This patch is completely wrong. Please do not apply.
On Tue, 10 Dec 2002, Justin Pryzby wrote:
> What was going on with 2.96<=__GNUC__<3 ?!
gcc-2.96 introduces unnamed unions and structures which we make heavy use
of in the NTFS driver. To be able to compile with earlier gcc versions, we
had to do some macro magic which is what the below code snippet in your
patch shows. The idea is that as soon as the official kernel requirements
for the minimum compiler are raised to gcc-2.96 or above, we will remove
all the macro magic and just leave everything unnamed.
Unfortunately the gcc crew fscked up and broke typedefs to unnamed unions
and structures in gcc-3.1 I think it was. This has since been fixed again
in the more recent gcc versions (gcc-3.2 is ok).
So if any special casing needs to be made below it would be to extend the
existing test with an || (__GNUC__ == 3 && __GNUC_MINOR__ == 1) but I
prefer not to do that. People should just upgrade their compiler. After
all it is the compiler that is broken not the code.
Best regards,
Anton
>
> Justin
>
> diff -Naur linux-2.5.51.org/fs/ntfs/types.h linux-2.5.51.ntfs/fs/ntfs/types.h
> --- linux-2.5.51.org/fs/ntfs/types.h 2002-12-10 02:17:52.000000000 -0500
> +++ linux-2.5.51.ntfs/fs/ntfs/types.h 2002-12-10 02:41:31.000000000 -0500
> @@ -23,12 +23,12 @@
> #ifndef _LINUX_NTFS_TYPES_H
> #define _LINUX_NTFS_TYPES_H
>
> -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
> -#define SN(X) X /* Struct Name */
> -#define SC(P,N) P.N /* ShortCut: Prefix, Name */
> -#else
> +#if __GNUC__ == 2 && __GNUC_MINOR__ >= 96
> #define SN(X)
> #define SC(P,N) N
> +#else
> +#define SN(X) X /* Struct Name */
> +#define SC(P,N) P.N /* ShortCut: Prefix, Name */
> #endif
>
> /* 2-byte Unicode character type. */
>
>
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-10 10:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-10 7:51 [PATCH] 2.5.51 ntfs - GCC3 Justin Pryzby
2002-12-10 10:12 ` [Linux-NTFS-Dev] " Anton Altaparmakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®