On Tue, 08 May 2007 17:15:53 +0200 Robert Cernansky <[EMAIL PROTECTED]> wrote:

RC> Mahogany 0.67 does not build on my system if using --with-python=none
RC> option. It cannot cast Profile* to int:
RC> 
RC> mail/MailFolderCC.cpp: In member function `bool 
MailFolderCC::Open(MailFolder::OpenMode)':
RC> mail/MailFolderCC.cpp:2478: error: cast from `Profile*' to `int' loses 
precision
RC> mail/MailFolderCC.cpp: In member function `virtual void 
MailFolderCC::ExpungeMessages()':
RC> mail/MailFolderCC.cpp:3314: error: cast from `Profile*' to `int' loses 
precision

 Thanks for reporting this and sorry for the delay with replying!

RC> It probably affects only 64-bit systems. Change from int to long in
RC> PY_CALLBACK stuff fixed it. Here is the patch:

 It doesn't seem right to cast pointers to longs (even if they're big
enough) and, more importantly, this shouldn't be necessary at all and the
cast only happens because the order of arguments in PY_CALLBACK is mixed up
when !USE_PYTHON. Below is my version of the fix, for reference.

 Thanks,
VZ

Index: include/Mcommon.h
===================================================================
--- include/Mcommon.h   (revision 7273)
+++ include/Mcommon.h   (working copy)
@@ -126,8 +126,9 @@
   These macros do nothing and return the default returnvalue when
   Python is disabled.
 */
+#ifdef   USE_PYTHON
+
 //@{
-#ifdef   USE_PYTHON
 /** This macro takes three arguments: the callback function name to
     look up in a profile, a default return value, and a profile
     pointer (can be NULL).
@@ -135,7 +136,9 @@
     object needs to support the GetClasName() method to get the Python
     class name for the argument.
 */
-#   define   PY_CALLBACK(name,default,profile)        
PythonCallback(name,default,this,this->GetClassName(),profile)
+#   define   PY_CALLBACK(name, def, profile) \
+   PythonCallback(name,def,this,this->GetClassName(),profile)
+
 /** This macro takes multiple arguments.
     The last argument is the default return value.
     The first argument is a list of arguments in brackets, it must
@@ -147,14 +150,15 @@
     must follow the format string.

 */
-#   define   PY_CALLBACKVA(arg,default)            PythonCallback arg
-#else
-#   define   PY_CALLBACK(name, profile, default)   PythonCallback((int)default)
-    inline int PythonCallback(int def) { return def; }
-#   define   PY_CALLBACKVA(arg,default)      PythonCallback((int)default)
-#endif
+#   define   PY_CALLBACKVA(arg, def)            PythonCallback arg
 //@}

+#else // !USE_PYTHON
+#   define   PY_CALLBACK(name, def, profile)   (def)
+#   define   PY_CALLBACKVA(arg, def)      (def)
+#endif // USE_PYTHON/!USE_PYTHON
+
+
 // ----------------------------------------------------------------------------
 // misc types
 // ----------------------------------------------------------------------------


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mahogany-Developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers

Reply via email to