patch-2.4.20 linux-2.4.20/include/linux/spinlock.h

Next file: linux-2.4.20/include/linux/sunrpc/clnt.h
Previous file: linux-2.4.20/include/linux/sonypi.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/include/linux/spinlock.h linux-2.4.20/include/linux/spinlock.h
@@ -68,9 +68,10 @@
 /*
  * Your basic spinlocks, allowing only a single CPU anywhere
  *
- * Most gcc versions have a nasty bug with empty initializers.
+ * Some older gcc versions had a nasty bug with empty initializers.
+ * (XXX: could someone please confirm whether egcs 1.1 still has this bug?)
  */
-#if (__GNUC__ > 2)
+#if (__GNUC__ > 2 || __GNUC_MINOR__ > 95)
   typedef struct { } spinlock_t;
   #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
 #else
@@ -131,9 +132,10 @@
  * irq-safe write-lock, but readers can get non-irqsafe
  * read-locks.
  *
- * Most gcc versions have a nasty bug with empty initializers.
+ * Some older gcc versions had a nasty bug with empty initializers.
+ * (XXX: could someone please confirm whether egcs 1.1 still has this bug?)
  */
-#if (__GNUC__ > 2)
+#if (__GNUC__ > 2 || __GNUC_MINOR__ > 91)
   typedef struct { } rwlock_t;
   #define RW_LOCK_UNLOCKED (rwlock_t) { }
 #else

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)