Issue 80023 - bean: jawt_md.h should be included before jawt.h
Summary: bean: jawt_md.h should be included before jawt.h
Status: CLOSED DUPLICATE of issue 81385
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Linux, all
: P3 Trivial
Target Milestone: ---
Assignee: Martin Hollmichel
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-25 12:21 UTC by pmladek
Modified: 2013-02-24 21:09 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Proposed change. (735 bytes, patch)
2007-07-25 12:22 UTC, pmladek
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description pmladek 2007-07-25 12:21:32 UTC
I had problems to compile the bean module with IMB Java on ppc:

IBM Java version:
--- cut ---
$> java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pxp32dev-20070511(SR5))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux ppc-32 j9vmxp3223-20070426
(JIT enabled)
J9VM - 20070420_12448_bHdSMR
JIT  - 20070419_1806_r8
GC   - 200704_19)
JCL  - 20070511
--- cut ---


I has got the following error message:
--- cut ---
In file included from com_sun_star_beans_LocalOfficeWindow.c:41:
/usr/lib/jvm/java/include/jawt.h:302: error: expected '=', ',', ';', 'asm' or '_
_attribute__' before 'jboolean'
dmake:  Error code 1, while making '../../unxlngppc.pro/slo/com_sun_star_beans_L
ocalOfficeWindow.obj'
---* tg_merge.mk *---

ERROR: Error 65280 occurred while making /usr/src/packages/BUILD/ooo-build-src68
0-m221/build/src680-m221/bean/native/unix
--- cut ---


Here is the snippet from jawt.h:
--- cut ---
_JNI_IMPORT_OR_EXPORT_                                                          
jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt);                           
--- cut ---


The problem is that _JNI_IMPORT_OR_EXPORT_ is defined in jawt_md.h and
com_sun_star_beans_LocalOfficeWindow.c includes it after jawt.h


Yeah, it looks like a bug in the IBM Java.

On the other hand, the jawt.h includes a sample code where only jawt_md.h is
included. I have found this sample even in Sun JDK.

I have checked gcj, Sun JDK and IBM JDK. It seems that jawt_md.h includes the
other two: jawt.h and jni.h in all three implemtations. So, it should be enough 
to include just the jawt_md.h.

I'll attach the proposed patch.
Comment 1 pmladek 2007-07-25 12:22:37 UTC
Created attachment 47077 [details]
Proposed change.
Comment 2 eric.bachard 2007-07-25 17:21:49 UTC
ericb->pmladeck 

FYI, no problem building m221 with IBM dk1.4.2, on Linux PowerPC
Comment 3 pmladek 2007-07-25 21:41:52 UTC
pmladek->ericb

I believe you. I think that there is a bug in the IBM JDK 1.5.0.

Anyway, I think the includes in OOo are unnecessary complex. We could change the
order of jawt_md.h and jawt.h at least.
Comment 4 Mathias_Bauer 2007-08-20 08:41:41 UTC
bean belongs to the API project
Comment 5 Martin Hollmichel 2007-08-22 15:16:40 UTC
set target.
Comment 6 pmladek 2007-09-11 13:04:35 UTC
Will be fixed in CWS pmladek06 as i#81385

*** This issue has been marked as a duplicate of 81385 ***
Comment 7 Mechtilde 2008-11-05 21:08:43 UTC
close the duplicate