classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches] RFC: replacing jni_md-x86-linux.h by a generic jni_md.h


From: Dalibor Topic
Subject: Re: [cp-patches] RFC: replacing jni_md-x86-linux.h by a generic jni_md.h
Date: Fri, 06 Jan 2006 04:01:00 +0100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)

Dalibor Topic wrote:
Tom Tromey wrote:

"Dalibor" == Dalibor Topic <address@hidden> writes:



Dalibor> the attached patch replaces the os/cpu/toolchain specific
Dalibor> jni-md.h by a generic version that uses fixed size C99's
Dalibor> types to typedef java types. It's been successfully used in
Dalibor> Kaffe for a while.

I think there are 2 problems with this patch.

Dalibor> +#include "config-int.h"

First, we need jni_md.h to be installed.  This means that config-int.h
must be installed ... but it isn't.


Thanks for spotting that bug, Tom, I'll post an updated version of the patch.


Fixed in the attached version.

Kaffe indeed installs config-int.h along with jni_md.h. I think the file should be renamed then to something like classpath_stdint_wrapper.h to make sure it differentiates itself from other headers.

I'll postpone this until we're in agreement about the patch.

And, simply installing it may be
wrong as it could redefine things like int8_t or whatever.


If the macro works as it should (delegating to stdint.h/inttypes.h when
those are available), I don't think that is going to be an issue. Could you elaborate?


Is this still an issue?

Dalibor> +/* Define some defaults */
Dalibor> +#define JNICALL
Dalibor> +#define JNIEXPORT
Dalibor> +#define JNIIMPORT

These aren't correct for Windows.  The old approach offered the
possibility of defining these correctly, at least in theory :-).

OK, I've decided to leave the current approach there as it is. So I've renamed the new default jni_md.h file to jni_md-c99-stdint.h. If no jni_md-$cpu-$os.h file exists then the new jni_md-c99-stdint.h file is linked as jni_md.h, as we've done to the x86-linux one.

cheers,
dalibor topic
Index: configure.ac
===================================================================
RCS file: /sources/classpath/classpath/configure.ac,v
retrieving revision 1.123
diff -u -r1.123 configure.ac
--- configure.ac        4 Jan 2006 16:37:55 -0000       1.123
+++ configure.ac        6 Jan 2006 02:52:05 -0000
@@ -429,9 +429,9 @@
   if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
     AC_MSG_RESULT(yes)
   else
-    target_cpu=x86
-    target_os=linux-gnu 
-    AC_MSG_WARN(no, using x86-linux-gnu)
+    target_cpu=c99
+    target_os=stdint 
+    AC_MSG_WARN([no, using c99-stdint])
   fi
   ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
   ac_dests="include/jni_md.h"
Index: include/Makefile.am
===================================================================
RCS file: /sources/classpath/classpath/include/Makefile.am,v
retrieving revision 1.52
diff -u -r1.52 Makefile.am
--- include/Makefile.am 4 Jan 2006 16:37:55 -0000       1.52
+++ include/Makefile.am 6 Jan 2006 02:52:05 -0000
@@ -1,4 +1,4 @@
-include_HEADERS = jni.h jni_md.h jawt.h jawt_md.h
+include_HEADERS = jni.h jni_md.h jawt.h jawt_md.h config-int.h
 
 DISTCLEANFILES = jni_md.h config-int.h
 
Index: include/jni_md-c99-stdint.h
===================================================================
RCS file: include/jni_md-c99-stdint.h
diff -N include/jni_md-c99-stdint.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ include/jni_md-c99-stdint.h 6 Jan 2006 02:52:06 -0000
@@ -0,0 +1,47 @@
+/* jni_md.h
+   Copyright (C) 2001, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+ 
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
+
+#ifndef __CLASSPATH_JNI_MD_H__
+#define __CLASSPATH_JNI_MD_H__
+
+#include "config-int.h"
+
+/* Define some defaults */
+#define JNICALL
+#define JNIEXPORT
+#define JNIIMPORT
+
+typedef uint8_t  jboolean;
+typedef int8_t   jbyte;
+typedef uint16_t jchar;
+typedef int16_t  jshort;
+typedef int32_t  jint;
+typedef int64_t  jlong;
+typedef float    jfloat;
+typedef double   jdouble;
+typedef jint     jsize;
+
+#endif /* __CLASSPATH_JNI_MD_H__ */
Index: include/jni_md-x86-linux-gnu.h
===================================================================
RCS file: include/jni_md-x86-linux-gnu.h
diff -N include/jni_md-x86-linux-gnu.h
--- include/jni_md-x86-linux-gnu.h      2 Jul 2005 20:32:22 -0000       1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,45 +0,0 @@
-/* jni_md.h
-   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
- 
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-As a special exception, if you link this library with other files to
-produce an executable, this library does not by itself cause the
-resulting executable to be covered by the GNU General Public License.
-This exception does not however invalidate any other reasons why the
-executable file might be covered by the GNU General Public License. */
-
-#ifndef __CLASSPATH_JNI_MD_H__
-#define __CLASSPATH_JNI_MD_H__
-
-/* Define some defaults */
-#define JNICALL
-#define JNIEXPORT
-#define JNIIMPORT
-
-typedef unsigned char jboolean;
-typedef signed char jbyte;
-typedef unsigned short jchar;
-typedef short jshort;
-typedef int jint;
-typedef long long jlong;
-typedef float jfloat;
-typedef double jdouble;
-typedef jint jsize;
-
-#endif /* __CLASSPATH_JNI_MD_H__ */

reply via email to

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