Re: [quickfix-developers] gcc 3.21 and Quickfix 1.4 JNI patches
Brought to you by:
orenmnero
From: <OM...@th...> - 2003-03-15 19:33:38
|
The patch has been applied. The build pages will report if any of the compilers have an issue with this. --oren |---------+-----------------------------------------------> | | Gene Gorokhovsky | | | <mus...@ya...> | | | Sent by: | | | qui...@li...ur| | | ceforge.net | | | | | | | | | 03/13/2003 10:58 AM | | | | |---------+-----------------------------------------------> >----------------------------------------------------------------------------------------------| | | | To: qui...@li... | | cc: Oren Miller <ore...@ya...> | | Subject: [quickfix-developers] gcc 3.21 and Quickfix 1.4 JNI patches | >----------------------------------------------------------------------------------------------| gcc3.21 (I build on Linux) does not compile qf 1.4 JNI layer as distrbuted. JVMObject is the primary culprit. I have attached two patches that deal with that. They have been tested on gcc 3.21, but I am pretty sure that they will work on every compiler QF currently supports. Below are technical explanation of the errors and corresponding patches. 1) This compiler does not allow passing non-const reference to a temporary. This can be fixed by rewriting initiating assignments as constructors (i.e. JVMObject a(newMessage()) instead of JVMOBject a = newMessage()), or changing the JVMOBject copy constructor to use a const temporary (attached patch uses latter) This error get flagged in JavaApplication.cpp and a few other files, fix requires changes in JVM.h. 2) It does not allow passing non-POD objects ("plain old data" - pointers,ints etc. and their direct derivations) through "..." argument. JVMObject is non-POD. The fix is either to make it POD (derive from jobject), or cast it to jobject explictly when such calls are made. Latter is less invasive so that what my patch does. This error occurs only in JavaApplication.h. Gene __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com158,159c158,159 < < JVMObject( const JVMObject& copy ) : m_obj(copy.m_obj) {} --- > > JVMObject( JVMObject& copy ) : m_obj(copy) {} 121c121 < pEnv->CallVoidMethod( m_object, notifyToAdminId, (jobject)jmsg, (jobject)jsessionid ); --- > pEnv->CallVoidMethod( m_object, notifyToAdminId, jmsg, jsessionid ); 135c135 < pEnv->CallVoidMethod( m_object, notifyToAppId, (jobject)jmsg, (jobject)jsessionid ); --- > pEnv->CallVoidMethod( m_object, notifyToAppId, jmsg, jsessionid ); |