On 13/06/2007 12:34, Laurent Vivier wrote:
> Ian Abbott wrote:
>> On 10/06/07 14:09, Laurent Vivier wrote:
>>> Hi,
>>>
>>> I'm trying to debug my application syncefs.
>>>
>>> the problem is as following :
>>>
>>> in my application, sizeof(CE_FIND_DATA) = 552 but in librapi2,
>>> in _CeFindAllFiles it seems to be 560 :
>>>
>>> src/rapi/file_management.c
>>>
>>> 71:                CE_FIND_DATA* array = calloc(count,
>>> sizeof(CE_FIND_DATA));
>>>
>>> 0xb7f78c31 <_CeFindAllFiles+200>:       mov    0xffffffec(%ebp),%eax
>>> 0xb7f78c34 <_CeFindAllFiles+203>:       movl   $0x230,0x4(%esp)
>>> 0xb7f78c3c <_CeFindAllFiles+211>:       mov    %eax,(%esp)
>>> 0xb7f78c3f <_CeFindAllFiles+214>:       call   0xb7f71398 <[EMAIL 
>>> PROTECTED]>
>>>
>>> If I compile librapi2 and pls on my system all is working fine, if I use
>>> librapi2 (0.9.3) from Debian etch and I compile pls on my system, when I
>>> run pls I have same issue.
>>>
>>> An idea why size of is different between librapi2 and my application ?
>>> I use gcc 4.1 but I have same behaviour with gcc-3.4.
>> I think you're picking up an out-of-date <synce_types.h> from somewhere.
>>  See
>> <http://www.mail-archive.com/synce-devel@lists.sourceforge.net/msg00341.html>
>> for the patch that changed MAX_PATH from 256 to 260.  This accounts for
>> the 8 byte difference in size that you are seeing in CE_FIND_DATA, and
>> also affects a few other types in <rapi.h>.
>>
> 
> Thank you.
> 
> It should be the good answer, so there is a problem with debian packages :
> 
> # grep MAX_PATH /usr/include/synce_types.h
> #define MAX_PATH  256
> 
> # dpkg -S /usr/include/synce_types.h
> libsynce0-dev: /usr/include/synce_types.h
> 
> # apt-cache show libsynce0-dev
> Package: libsynce0-dev
> Priority: optional
> Section: libdevel
> Installed-Size: 140
> Maintainer: Volker Christian <[EMAIL PROTECTED]>
> Architecture: i386
> Source: libsynce
> Version: 0.9.3-1
> Depends: libsynce0 (= 0.9.3-1)
> Suggests: librapi2-dev
> Filename: pool/main/libs/libsynce/libsynce0-dev_0.9.3-1_i386.deb
> Size: 25258
> MD5sum: 5f22c4fdc6805766d192fb7451bfec8a
> SHA1: 54141639382ae4ccedf4df81b8c237bb346d10f4
> SHA256: e3142e6a31a1ef262f116a3e30d60bd6ddd961ddf6d54ed470b9ed9ca829252c
> Description: A helper library for synce, a tool to sync WinCE devices
>  This package contains the development files
> Tag: devel::library, role::devel-lib
> 
> # objdump -D /usr/lib/librapi.so.2.0.0
> 00006cbb <_CeFindAllFiles2>:
> ...
>     6daa:       0f 84 0c 03 00 00       je     70bc <_CeFindAllFiles2+0x401>
>     6db0:       8b 45 ec                mov    0xffffffec(%ebp),%eax
>     6db3:       c7 44 24 04 30 02 00    movl   $0x230,0x4(%esp)
>     6dba:       00
>     6dbb:       89 04 24                mov    %eax,(%esp)
>     6dbe:       e8 d5 c5 ff ff          call   3398 <[EMAIL PROTECTED]>
> 
> # dpkg -S /usr/lib/librapi.so.2.0.0
> librapi2: /usr/lib/librapi.so.2.0.0
> 
> # apt-cache show librapi2
> Package: librapi2
> Priority: optional
> Section: libs
> Installed-Size: 116
> Maintainer: Volker Christian <[EMAIL PROTECTED]>
> Architecture: i386
> Version: 0.9.3-3
> Depends: libc6 (>= 2.3.6-6), libsynce0
> Suggests: synce-dccm, librra0, librapi2-tools
> Filename: pool/main/libr/librapi2/librapi2_0.9.3-3_i386.deb
> Size: 24916
> MD5sum: 194fe16320d801a46e822b380428cf9b
> SHA1: b23f29b17f60b02ab11cab7e75ebaf258047cfae
> SHA256: e526dd5edd8a1def0027122fb1d7e259f5200ba84b25d7480bc7b1d151291bdf
> Description: Make RAPI calls to a WinCE device, runtime libraries
>  This library is equivalent to rapi.dll on a Windows machine. It allows you
>  to make remote calls to your WinCE device.
> Tag: role::shared-lib
> 
> I guess the build environment of this package is corrupted.

You could use an ugly workaround in your application by adding this 
before any other #includes that include <synce_types.h> directly or 
indirectly:

#include <synce_types.h>
#undef MAX_PATH
#define MAX_PATH 260

It would be better if Debian's libsynce0-dev package was patched though.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <[EMAIL PROTECTED]>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

-------------------------------------------------------------------------
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/
_______________________________________________
SynCE-Devel mailing list
SynCE-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel

Reply via email to