Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile.mingw and Python #56

Open
GoogleCodeExporter opened this issue Mar 24, 2015 · 11 comments
Open

Makefile.mingw and Python #56

GoogleCodeExporter opened this issue Mar 24, 2015 · 11 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Compilation with MinGW is broken. Details below.

First symptom is this:
In file included from xdelta3.c:269:
xdelta3.h:102: error: conflicting types for 'ssize_t'

This is easily fixed by the attached patch, but you
specifically use _strtoi64 for win32: is it an msvc
thing? Both mingw and lcc provide strtoimax (through
inttypes.h), and strtoll. strtoi64 isn't there for
mingw32. Is there an issue with strtoll itself, or
does msvc not provide it?

Besides, I must pass -DEXTERNAL_COMPRESSION=0 to the
compiler, right?

Anyways, here's the output for xdelta3-decoder target:

/usr/local/cross-tools/bin/i386-mingw32msvc-gcc -O3 -Wall -Wshadow xdelta3.c \
    -DXD3_ENCODER=0 -DXD3_MAIN=1 -DSECONDARY_FGK=0 -DSECONDARY_DJW=0 \
    -DXD3_STDIO=1 -DEXTERNAL_COMPRESSION=0 -DVCDIFF_TOOLS=0 \
    -o xdelta3-decoder
In file included from xdelta3.c:269:
xdelta3.h:102: error: conflicting types for 'ssize_t'
/usr/local/cross-tools/lib/gcc/i386-mingw32msvc/3.4.5/../../../../i386-mingw32ms
vc/include/sys/types.h:104:
error: previous declaration of 'ssize_t' was here
In file included from xdelta3.c:789:
xdelta3-main.h: In function `get_millisecs_now':
xdelta3-main.h:537: warning: dereferencing type-punned pointer will break
strict-aliasing rules
xdelta3-main.h: In function `main_strtoxoff':
xdelta3-main.h:607: warning: implicit declaration of function `_strtoi64'
xdelta3.c: At top level:
xdelta3.h:1117: warning: 'xd3_init_config' defined but not used
xdelta3.h:1154: warning: 'xd3_encoder_srcbase' defined but not used
xdelta3.h:1158: warning: 'xd3_encoder_srclen' defined but not used
xdelta3.h:1165: warning: 'xd3_set_flags' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_init' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_push_back' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_remove' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_pop_back' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_pop_front' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_empty' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_front' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_back' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_end' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_next' defined but not used
xdelta3.c:363: warning: 'xd3_rlist_length' defined but not used
xdelta3-hash.h:137: warning: 'xd3_checksum_hash' defined but not used
xdelta3-hash.h:148: warning: 'xd3_lcksum' defined but not used
xdelta3-hash.h:177: warning: 'xd3_scksum' defined but not used
xdelta3-main.h:258: warning: 'main_blklru_list_pop_back' defined but not used
xdelta3-main.h:258: warning: 'main_blklru_list_front' defined but not used
xdelta3-main.h:258: warning: 'main_blklru_list_back' defined but not used
xdelta3-main.h:258: warning: 'main_blklru_list_end' defined but not used
xdelta3-main.h:258: warning: 'main_blklru_list_next' defined but not used
xdelta3-main.h:258: warning: 'main_blklru_list_length' defined but not used
make: *** [xdelta3-decoder] Error 1


Original issue reported on code.google.com by seze...@gmail.com on 14 Dec 2007 at 11:40

Attachments:

@GoogleCodeExporter
Copy link
Author

As far as I remember, strtoi64 wsa used because strtoll was not available in 
MSVC.

The EXTERNAL_COMPRESSION stuff enables a bunch of POSIX code which probably 
won't
work. I'm open to suggestions.  A while back someone suggested I look at 
"groff" for
a portable implementation of this stuff.

Original comment by josh.mac...@gmail.com on 14 Dec 2007 at 6:39

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

OK, here is an initial patch:

* Makefile adjustsments: adds -DEXTERNAL_COMPRESSION=0 and changes the
-DXD3_STDIO=1 to -DXD3_STDIO=0 -DXD3_POSIX=0 -DXD3_WIN32=1 for targets
xdelta3, xdelta3-debug, xdelta3-32, xdelta3-debug2, xdelta3-debug3 and
xdelta3-decoder .  Didn't bother adding .exe to generated binary names
and it would be best to make a new makefile named Makefile.mingw or
something.

* xdelta3.h: moved the XD3_USE_LARGEFILE64 definition to a place before
windows.h is included. Added compile time options:
if XD3_USE_LARGEFILE64 : set WINVER and _WIN32_WINNT to 0x0500 which
requires WinME, or Win2000 and or newer version of WinNT, uses 64 bit
file offsets (GetFileSizeEx and SetFilePointerEx)
if !XD3_USE_LARGEFILE64 : set WINVER and _WIN32_WINNT to 0x0400 which
is compatible with win95-98 and WinNT4, uses 32 bit (DWORD) file offsets
(GetFileSize and SetFilePointer)
This should also handle the issue #16 about GetFileSizeEx, somehow.

* xdelta3.h :  #ifndef _MSC_VER : uses stdint.h for most type definitions
and does not empty-define inline

* xdelta3-main.h :  uses _strtoi64 only with _MSC_VER, otherwise uses
strtoll

* xdelta3-main.h :  according to the _WIN32_WINNT values defined above,
uses GetFileSize and SetFilePointer for 32 bit file offsets, or the 'Ex'
ones for 64 bits.

With this patch applied, I successfully compiled the targets I mentioned.
I used a cross-toolchain on redhat9, details:
gcc-core-3.4.5-20060117-1
gcc-g++-3.4.5-20060117-1
binutils-2.17.50-20070129-1
w32api-3.10
mingw-runtime-3.13

Here are the only warnings I got:

In file included from xdelta3.c:789:
xdelta3-main.h: In function `get_millisecs_now':
xdelta3-main.h:557: warning: dereferencing type-punned pointer will break
strict-aliasing rules
xdelta3.c: At top level:
xdelta3-test.h:347: warning: 'test_save_copy' defined but not used
xdelta3-test.h:1600: warning: 'test_command_line_arguments' defined but not used
xdelta3-test.h:1916: warning: 'test_recode_command' defined but not used
xdelta3-test.h:2138: warning: 'test_force_behavior' defined but not used
xdelta3-test.h:2170: warning: 'test_stdout_behavior' defined but not used
xdelta3-test.h:2204: warning: 'test_no_output' defined but not used

Cheers.


Original comment by seze...@gmail.com on 14 Dec 2007 at 9:50

Attachments:

@GoogleCodeExporter
Copy link
Author

Hmm, the patch I attached had some illegal GetFileSize/SetFilePointer
usage, result: seg.. Good one attached, run-tested on win98 and winxp.

Cheers.


Original comment by seze...@gmail.com on 14 Dec 2007 at 11:46

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks!

BTW: I've had an accident w/ my windows laptop today, and won't be able to test 
build
w/ MSVC or Cygwin in the foreseeable future.  (Working at the laundromat, 
bleach,
battery, badness.)

See if SVN 221 does the trick.

Original comment by josh.mac...@gmail.com on 15 Dec 2007 at 12:37

@GoogleCodeExporter
Copy link
Author

Seems to compile fine with my mingw. Will run-test in an hour,
thanks. The makefile shall need some serious lovin' though ;)


Original comment by seze...@gmail.com on 15 Dec 2007 at 12:53

@GoogleCodeExporter
Copy link
Author

OK, it's good, tested on win98se with 32bit mode. My patch application
now runs fine on linux, dos and win32, and should also work on other
unices.  As a data point for you, patching of two files, one 21 MB and
one 75 MB, on my pentium-120 machine with 32 MB ram takes 4 minutes
whereas the similar application using xdelta-1.1.4 took around 32 mins
on DOS with no disk read-cache TSRs active.

Thanks.


Original comment by seze...@gmail.com on 15 Dec 2007 at 1:33

@GoogleCodeExporter
Copy link
Author

Great! Thanks.

Original comment by josh.mac...@gmail.com on 15 Dec 2007 at 1:55

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Attached a tiny patch (svn221-fix-comments.diff) that fixes a comment
about windows version requirements. no code change.


Original comment by seze...@gmail.com on 15 Dec 2007 at 8:02

Attachments:

@GoogleCodeExporter
Copy link
Author

Attached an initial patch to the mingw makefile: Contains some FIXMEs,
especially about those python stuff (which I'm clueless about). Shall
need additional look from your side.


Original comment by seze...@gmail.com on 15 Dec 2007 at 8:05

Attachments:

@GoogleCodeExporter
Copy link
Author

I would really like to use a Python module on Windows, up until now I've been 
using
Cygwin for Python development on Windows. Sadly, my Windows machine is dead at 
the
moment, so I'll leave this issue open.

Original comment by josh.mac...@gmail.com on 15 Dec 2007 at 6:39

  • Changed title: Makefile.mingw and Python
  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Can't someone make the Windows Python version available?

Original comment by dmpem...@yahoo.com on 22 Sep 2008 at 6:02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant