* cgraph.c (dump_cgraph_varpool_node): Don't crash if called
[official-gcc.git] / libjava / include / jni_md.h
blobc550338acd7014cc29938bd01c954b31d17dc79c
1 /* jni_md.h
2 Copyright (C) 2001, 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 As a special exception, if you link this library with other files to
22 produce an executable, this library does not by itself cause the
23 resulting executable to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
27 #ifndef __GCJ_JNI_MD_H__
28 #define __GCJ_JNI_MD_H__
30 #include <gcj/libgcj-config.h>
32 #ifdef __GCJ_JNI_IMPL__
34 /* If __GCJ_JNI_IMPL__ is defined, then we assume that we're building
35 libgcj itself, and we include headers which taint the namespace
36 more than is acceptable for the ordinary JNI user. */
37 #include <gcj/javaprims.h>
38 #include <gcj/array.h>
39 #include <gnu/gcj/runtime/JNIWeakRef.h>
41 typedef gnu::gcj::runtime::JNIWeakRef *jweak;
43 typedef struct _Jv_JNIEnv JNIEnv;
44 typedef struct _Jv_JavaVM JavaVM;
46 #define JNI_TRUE true
47 #define JNI_FALSE false
49 /* We defined jobject and friends, so don't redefine them in jni.h. */
50 #define _CLASSPATH_VM_JNI_TYPES_DEFINED
52 /* We defined jmethodID and and jfieldID, so don't redefine them in
53 jni.h. */
54 #define _CLASSPATH_VM_INTERNAL_TYPES_DEFINED
56 /* Contents of the JNIEnv; but only inside the implementation. */
57 #define _CLASSPATH_JNIENV_CONTENTS \
58 /* The current exception. */ \
59 jthrowable ex; \
61 /* The class of the current native method. */ \
62 jclass klass; \
64 /* The chain of local frames. */ \
65 struct _Jv_JNI_LocalFrame *locals; \
67 /* The bottom-most element of the chain, initialized with the env and \
68 reused between non-nesting JNI calls. */ \
69 struct _Jv_JNI_LocalFrame *bottom_locals;
72 #else /* __GCJ_JNI_IMPL__ */
74 # ifdef __GNUC__
76 /* If we're using gcc, we can use a platform-independent scheme to get
77 the right integer types. FIXME: this is not always correct, for
78 instance on the c4x it will be wrong -- it depends on whether
79 QImode is 8 bits. */
80 typedef int jbyte __attribute__((__mode__(__QI__)));
81 typedef int jshort __attribute__((__mode__(__HI__)));
82 typedef int jint __attribute__((__mode__(__SI__)));
83 typedef int jlong __attribute__((__mode__(__DI__)));
84 typedef int jboolean __attribute__((__mode__(__QI__)));
85 typedef unsigned short jchar __attribute__((__mode__(__HI__)));
86 typedef float jfloat;
87 typedef double jdouble;
88 typedef jint jsize;
90 # else /* __GNUC__ */
92 # ifdef JV_HAVE_INTTYPES_H
94 /* If <inttypes.h> is available, we use it. */
96 # include <inttypes.h>
98 typedef int8_t jbyte;
99 typedef int16_t jshort;
100 typedef int32_t jint;
101 typedef int64_t jlong;
102 typedef float jfloat;
103 typedef double jdouble;
104 typedef jint jsize;
105 typedef int8_t jboolean;
106 typedef uint16_t jchar;
108 # else /* JV_HAVE_INTTYPES_H */
110 /* For now, we require either gcc or <inttypes.h>. If we did more
111 work at configure time we could get around this, but right now it
112 doesn't seem worth it. */
113 # error jni.h not ported to this platform
115 # endif /* JV_HAVE_INTTYPES_H */
117 # endif /* __GNUC__ */
119 #endif /* __GCJ_JNI_IMPL__ */
122 /* Linkage and calling conventions. */
123 #if defined (_WIN32) || defined (__WIN32__) || defined (WIN32)
125 #define JNIIMPORT __declspec(dllimport)
126 #define JNIEXPORT __declspec(dllexport)
128 #define JNICALL __stdcall
130 /* These defines apply to symbols in libgcj */
131 #ifdef __GCJ_DLL__
132 # ifdef __GCJ_JNI_IMPL__
133 # define _CLASSPATH_JNIIMPEXP JNIEXPORT
134 # else
135 # define _CLASSPATH_JNIIMPEXP JNIIMPORT
136 # endif /* ! __GCJ_JNI_IMPL__ */
137 #else /* ! __GCJ_DLL__ */
138 # define _CLASSPATH_JNIIMPEXP
139 #endif /* __GCJ_DLL__ */
141 #else /* !( _WIN32 || __WIN32__ || WIN32) */
143 #define JNIIMPORT
144 #define JNIEXPORT
145 #define JNICALL
146 #define _CLASSPATH_JNIIMPEXP
148 #endif /* !( _WIN32 || __WIN32__ || WIN32) */
151 #endif /* __GCJ_JNI_MD_H__ */