PatchSet 5640 
Date: 2005/04/01 21:32:19
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Fixlet for gcc 2.9x

2005-04-01  gian paolo ciceri <[EMAIL PROTECTED]>

* config/katomic.h (__atomic_val_bysize, __atomic_bool_bysize):
Added versions for gcc 2.x variadic macro format.

Members: 
        ChangeLog:1.3810->1.3811 
        config/katomic.h:1.1->1.2 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3810 kaffe/ChangeLog:1.3811
--- kaffe/ChangeLog:1.3810      Fri Apr  1 20:37:33 2005
+++ kaffe/ChangeLog     Fri Apr  1 21:32:19 2005
@@ -1,3 +1,8 @@
+2005-04-01  gian paolo ciceri <[EMAIL PROTECTED]>
+
+       * config/katomic.h (__atomic_val_bysize, __atomic_bool_bysize): 
+       Added versions for gcc 2.x variadic macro format.
+
 2005-04-01  Supreet Sethi  <[EMAIL PROTECTED]>
 
        * configure.ac: Check for uintmax_t and intmax_t.
Index: kaffe/config/katomic.h
diff -u kaffe/config/katomic.h:1.1 kaffe/config/katomic.h:1.2
--- kaffe/config/katomic.h:1.1  Sun Mar 20 20:30:37 2005
+++ kaffe/config/katomic.h      Fri Apr  1 21:32:21 2005
@@ -26,6 +26,43 @@
 /* Wrapper macros to call pre_NN_post (mem, ...) where NN is the
    bit width of *MEM.  The calling macro puts parens around MEM
    and following args.  */
+   
+   
+#if __GNUC__ == 2 
+
+#define __atomic_val_bysize(pre, post, mem, args...)                         \
+  ({                                                                         \
+    __typeof (*mem) __result;                                                \
+    if (sizeof (*mem) == 1)                                                  \
+      __result = pre##_8_##post (mem, args...);                                
      \
+    else if (sizeof (*mem) == 2)                                             \
+      __result = pre##_16_##post (mem, args...);                             \
+    else if (sizeof (*mem) == 4)                                             \
+      __result = pre##_32_##post (mem, args...);                             \
+    else if (sizeof (*mem) == 8)                                             \
+      __result = pre##_64_##post (mem, args...);                             \
+    else                                                                     \
+      abort ();                                                                
      \
+    __result;                                                                \
+  })
+#define __atomic_bool_bysize(pre, post, mem, args...)                        \
+  ({                                                                         \
+    int __result;                                                            \
+    if (sizeof (*mem) == 1)                                                  \
+      __result = pre##_8_##post (mem, args...);                                
      \
+    else if (sizeof (*mem) == 2)                                             \
+      __result = pre##_16_##post (mem, args...);                             \
+    else if (sizeof (*mem) == 4)                                             \
+      __result = pre##_32_##post (mem, args...);                             \
+    else if (sizeof (*mem) == 8)                                             \
+      __result = pre##_64_##post (mem, args...);                             \
+    else                                                                     \
+      abort ();                                                                
      \
+    __result;                                                                \
+  })
+
+#else
+  
 #define __atomic_val_bysize(pre, post, mem, ...)                             \
   ({                                                                         \
     __typeof (*mem) __result;                                                \
@@ -56,7 +93,10 @@
       abort ();                                                                
      \
     __result;                                                                \
   })
-
+  
+  
+#endif
+  
 
 /* Atomically store NEWVAL in *MEM if *MEM is equal to OLDVAL.
    Return the old *MEM value.  */

_______________________________________________
kaffe mailing list
[email protected]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to