Q) jdk1.4.1 compile on -current
Sheldon Hearn
sheldonh at starjuice.net
Sun Jul 27 06:24:03 PDT 2003
On (2003/07/27 15:05), Sheldon Hearn wrote:
> > It's not a GCC bug, it's a JDK bug which GCC used to silently ignore.
> > The ## operator should only be used to paste together parts of what is
> > meant to be a single token, but apparently a lot of people use it
> > between tokens in macro definitions (which is not only incorrect but
> > also completely unnecessary).
>
> So name##_t is supposed to be name_t? Any idea what the original
> programmer wanted to achieve or avoid by doing this?
Ah, wait. Those are bad examples (and don't produce errors).
I've just looked at the standard and seen what you're talking about.
It's easy to imagine the author of the failing code thinking this was
necessary.
The enclosed patch might fix the compile failure.
Ciao,
Sheldon.
--- ../../hotspot/src/share/vm/prims/jni.cpp.orig Sun Jul 27 15:11:28 2003
+++ ../../hotspot/src/share/vm/prims/jni.cpp Sun Jul 27 15:14:28 2003
@@ -902,7 +902,7 @@
JNI_ArgumentPusherVaArg ap(methodID, args); \
jni_invoke_nonstatic(env, &jvalue, obj, JNI_VIRTUAL, methodID, &ap, CHECK_0); \
va_end(args); \
- return (ResultType)(jvalue._value.##unionType); \
+ return (ResultType)(jvalue._value.unionType); \
JNI_END \
\
\
@@ -912,7 +912,7 @@
JavaValue jvalue(Tag); \
JNI_ArgumentPusherVaArg ap(methodID, args); \
jni_invoke_nonstatic(env, &jvalue, obj, JNI_VIRTUAL, methodID, &ap, CHECK_0); \
- return (ResultType)(jvalue._value.##unionType); \
+ return (ResultType)(jvalue._value.unionType); \
JNI_END \
\
\
@@ -922,7 +922,7 @@
JavaValue jvalue(Tag); \
JNI_ArgumentPusherArray ap(methodID, args); \
jni_invoke_nonstatic(env, &jvalue, obj, JNI_VIRTUAL, methodID, &ap, CHECK_0); \
- return (ResultType)(jvalue._value.##unionType); \
+ return (ResultType)(jvalue._value.unionType); \
JNI_END
// the runtime type of subword integral basic types is integer
@@ -976,7 +976,7 @@
JNI_ArgumentPusherVaArg ap(methodID, args); \
jni_invoke_nonstatic(env, &jvalue, obj, JNI_NONVIRTUAL, methodID, &ap, CHECK_0); \
va_end(args); \
- return (ResultType)(jvalue._value.##unionType); \
+ return (ResultType)(jvalue._value.unionType); \
JNI_END \
\
\
@@ -986,7 +986,7 @@
JavaValue jvalue(Tag); \
JNI_ArgumentPusherVaArg ap(methodID, args); \
jni_invoke_nonstatic(env, &jvalue, obj, JNI_NONVIRTUAL, methodID, &ap, CHECK_0); \
- return (ResultType)(jvalue._value.##unionType); \
+ return (ResultType)(jvalue._value.unionType); \
JNI_END \
\
\
@@ -996,7 +996,7 @@
JavaValue jvalue(Tag); \
JNI_ArgumentPusherArray ap(methodID, args); \
jni_invoke_nonstatic(env, &jvalue, obj, JNI_NONVIRTUAL, methodID, &ap, CHECK_0); \
- return (ResultType)(jvalue._value.##unionType); \
+ return (ResultType)(jvalue._value.unionType); \
JNI_END
// the runtime type of subword integral basic types is integer
@@ -1051,7 +1051,7 @@
JNI_ArgumentPusherVaArg ap(methodID, args); \
jni_invoke_static(env, &jvalue, NULL, JNI_STATIC, methodID, &ap, CHECK_0); \
va_end(args); \
- return (ResultType)(jvalue._value.##unionType); \
+ return (ResultType)(jvalue._value.unionType); \
JNI_END \
\
\
@@ -1061,7 +1061,7 @@
JavaValue jvalue(Tag); \
JNI_ArgumentPusherVaArg ap(methodID, args); \
jni_invoke_static(env, &jvalue, NULL, JNI_STATIC, methodID, &ap, CHECK_0); \
- return (ResultType)(jvalue._value.##unionType); \
+ return (ResultType)(jvalue._value.unionType); \
JNI_END \
\
\
@@ -1071,7 +1071,7 @@
JavaValue jvalue(Tag); \
JNI_ArgumentPusherArray ap(methodID, args); \
jni_invoke_static(env, &jvalue, NULL, JNI_STATIC, methodID, &ap, CHECK_0); \
- return (ResultType)(jvalue._value.##unionType); \
+ return (ResultType)(jvalue._value.unionType); \
JNI_END
// the runtime type of subword integral basic types is integer
@@ -1204,7 +1204,7 @@
/* and creates a ResetNoHandleMark. */ \
if (jvmdi::enabled()) { \
jvalue field_value; \
- field_value.##unionType = value; \
+ field_value.unionType = value; \
o = jvmdi::jni_SetField_probe_nh(thread, obj, o, k, fieldID, false, SigType, (jvalue *)&field_value); \
} \
o->Fieldname##_field_put(offset, value); \
@@ -1333,7 +1333,7 @@
/* jni_SetField_probe() assumes that is okay to create handles. */ \
if (jvmdi::enabled()) { \
jvalue field_value; \
- field_value.##unionType = value; \
+ field_value.unionType = value; \
jvmdi::jni_SetField_probe(thread, NULL, NULL, id->holder(), fieldID, true, SigType, (jvalue *)&field_value); \
} \
id->holder()-> Fieldname##_field_put (id->offset(), value); \
More information about the freebsd-java
mailing list