classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] __attribute__ patch (Was: Re: RFC: __attribute__ handling)


From: Christian Thalinger
Subject: [cp-patches] __attribute__ patch (Was: Re: RFC: __attribute__ handling)
Date: Tue, 04 Oct 2005 20:28:40 +0200

On Tue, 2005-10-04 at 10:01 -0600, Tom Tromey wrote:
> >>>>> "Twisti" == Christian Thalinger <address@hidden> writes:
> 
> >> Why only if !__cplusplus?
> 
> Twisti> Hmm, that seems to be a copy-paste bug.  AFAIK a C++ compiler
> Twisti> always has the `inline' keyword.  It should be removed and
> Twisti> simply be defined.
> 
> This seems ok to me then.

Here is the actual patch.  Tested on IRIX with MIPSPro compiler.

TWISTI


2005-10-04  Christian Thalinger  <address@hidden>

        * m4/acattribute.m4: Added.
        * configure.ac: Added AC_C_ATTRIBUTE.
        * native/fdlibm/java-assert.h: Added missing config.h include, 
        changed comments to C comments.
        * native/jni/java-lang/java_lang_reflect_Array.c: Added missing 
        config.h include.


diff -Nur ../classpath-0.18/m4/acattribute.m4 m4/acattribute.m4
--- ../classpath-0.18/m4/acattribute.m4
+++ m4/acattribute.m4   Tue Oct  4 19:24:41 2005
@@ -0,0 +1,25 @@
+dnl modified AC_C_INLINE from autoconf/c.m4
+
+AN_IDENTIFIER([attribute], [AC_C_ATTRIBUTE])
+AC_DEFUN([AC_C_ATTRIBUTE],
+[AC_CACHE_CHECK([for __attribute__], ac_cv_c_attribute,
+[
+AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+[void foo(void) __attribute__ ((__noreturn__));]
+)],
+[ac_cv_c_attribute=yes],
+[ac_cv_c_attribute=no]
+)
+])
+AH_VERBATIM([attribute],
+[/* Define to `__attribute__' to nothing if it's not supported.  */
+#undef __attribute__])
+case $ac_cv_c_attribute in
+  yes) ;;
+  no)
+    cat >>confdefs.h <<_ACEOF
+#define __attribute__(x)    /* nothing */
+_ACEOF
+    ;;
+esac
+])# AC_C_ATTRIBUTE

Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.109
diff -u -3 -p -r1.109 configure.ac
--- configure.ac        3 Oct 2005 01:53:12 -0000       1.109
+++ configure.ac        4 Oct 2005 18:00:22 -0000
@@ -268,6 +268,7 @@ if test "x${COMPILE_JNI}" = xyes; then
           [AC_MSG_RESULT(no)])])])
 
   AC_C_CONST
+  AC_C_ATTRIBUTE
 
   dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
   AM_ICONV
Index: native/fdlibm/java-assert.h
===================================================================
RCS file: /cvsroot/classpath/classpath/native/fdlibm/java-assert.h,v
retrieving revision 1.1
diff -u -3 -p -r1.1 java-assert.h
--- native/fdlibm/java-assert.h 5 Nov 2001 02:56:47 -0000       1.1
+++ native/fdlibm/java-assert.h 4 Oct 2005 18:00:24 -0000
@@ -1,4 +1,4 @@
-// java-assert.h - Header file holding assertion definitions.  -*- c++
-*-
+/* java-assert.h - Header file holding assertion definitions.  -*- c++
-*- */
 
 /* Copyright (C) 1998, 1999  Free Software Foundation
 
@@ -11,7 +11,9 @@ details.  */
 #ifndef __JAVA_ASSERT_H__
 #define __JAVA_ASSERT_H__
 
-// This is a libgcj implementation header.
+#include <config.h>
+
+/* This is a libgcj implementation header. */
 
 void _Jv_Abort (const char *, const char *, int, const char *)
   __attribute__ ((__noreturn__));
Index: native/jni/java-lang/java_lang_reflect_Array.c
===================================================================
RCS
file: 
/cvsroot/classpath/classpath/native/jni/java-lang/java_lang_reflect_Array.c,v
retrieving revision 1.10
diff -u -3 -p -r1.10 java_lang_reflect_Array.c
--- native/jni/java-lang/java_lang_reflect_Array.c      2 Jul 2005
20:32:55 -0000       1.10
+++ native/jni/java-lang/java_lang_reflect_Array.c      4 Oct 2005
18:00:24 -0000
@@ -42,6 +42,7 @@ exception statement from your version. *
  * Date: 2 Jun 1998
  */
 
+#include <config.h>
 #include <stddef.h>
 
 #include "java_lang_reflect_Array.h"






reply via email to

[Prev in Thread] Current Thread [Next in Thread]