[vlc-devel] [PATCH 0/4] win32 *printf fixes

davidf+nntp at woaf.net davidf+nntp at woaf.net
Wed Apr 1 23:40:01 CEST 2009


From: David Flynn <davidf at rd.bbc.co.uk>

This set stops using the vsnprintf provided by mingw and migrates
to using the MSVCRT implementation.

Plese test that it works (for the last two patches, i've only tested that it
builds).  Please test that it works on WinCE too.

I had started down the road of porting klibc's snprintf, which is c99
compliant, apart from the fact it has no double support.  Printing doubles
in a c99 compliant manner is a load of work, that can be approximated, but
rather undermines the point of stealing a known good implementation.

My new theory is this:
 - mingw tries to provide an snprintf version.  in the 3.13 runtime, it is
   buggy.  The current version is 3.15 which is drastically different.
 - this should be treated like any other compiler bug[1], don't work around
   it, use the fixed version.
 - the debian mingw32 package maintainer ought to be shot for his severe
   neglect in not maintaining the mingw32 packages for over 1.5years.

[1] -- As long as the wince builds use the mingwex library (statically linked
automatically by mingw).

..david

avaliable from:
  git://repo.or.cz/vlc/davidf-public.git df-fixes-20090331

Viewable via gitweb at:
  http://repo.or.cz/w/vlc/davidf-public.git?a=shortlog;h=refs/heads/df-fixes-20090331

To test:
  $ git fetch git://repo.or.cz/vlc/davidf-public.git df-fixes-20090331
  $ git checkout FETCH_HEAD

To verify the contents of the branch:
  (assuming git fetch has occured)
  $ git log ^origin/master FETCH_HEAD

My advice is not to pull this branch, without checking the above; and then
to do:
  $ git checkout -b your-candidate-branch origin/master
  for each commit you like:
  do
    $ git cherry-pick -s <commitid>
  done

David Flynn (4):
  win32: fix %zu fixups - dont use mingw's vsnprintf
  win32: vlc_fix_format_string - various fixes
  win32: make vlc_vsnprintf more like c99 vsnprintf
  win32: remove old attempts to define snprintf _snprintf

 include/vlc_common.h |    8 ---
 include/vlc_fixups.h |  139 +++++++++++++++++++++++++++++--------------------
 2 files changed, 82 insertions(+), 65 deletions(-)




More information about the vlc-devel mailing list