git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH 00/14] Build git with MSVC

From
Marius Storm-Olsen <mstormo@gmail.com>
Date
Aug 21, 2009, 13:30 UTC
Message-ID
<cover.1250860247.git.mstormo@gmail.com>

So, Frank Li started this series, and I took it upon my self to help out a bit; cleaning, reorganizing, rebasing the series. Hopefully we're now a bit closer to including the series into mainline..

Here's a summary of what has happend:
1) This series is rebased ontop of git.git 'next', which needed an
   extra patch to avoid a non-constant array creation, which
   mscv doesn't like.
2) I've polished (tied to anyways) the commit messages a bit.
3) I've applied much of the feedback provided to the first round of
   the patches.
4) I've split, merged and reordered some of the patches, so things
   that belong together are in the same commits, and in a order of
   'importance'
5) I've removed the
       #define func _func
   stuff, as it's not needed and Microsoft cannot really kill the
   compatibility functions anyways. So, adding the define
       _CRT_NONSTDC_NO_DEPRECATE
   will kill the warnings seen without the defines above.
6) ..probably much more as well, but I forget..
Note: I did not sign off on the last two commits, which involve the
adding of the vcproj files, since I don't agree on adding them as is.
We need a Makefile way of compiling primarily, and second, a script
to generate the vcproj, as already discussed. But the commits are
included for completeness, at to let others compile and play with it.

I've kept the original author as is, and just signed the patches.. Thanks for watching, now bring on the comments!

Frank Li (11):
  Avoid declaration after statement
  Define SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++
  Change regerror() declaration from K&R style to ANSI C (C89)
  mingw.c: Use the O_BINARY flag to open files
  Fix __stdcall/WINAPI placement and function prototype
  Test for WIN32 instead of __MINGW32_
  Avoid including windows.h in winansi.c for MSVC build
  Add MinGW header files to build git with MSVC
  Add platform files for MSVC porting
  Add MSVC project files
  Add README and gitignore file for MSVC build
Marius Storm-Olsen (3):
  Fix non-constant array creation
  Add define guards to compat/win32.h
  Add empty header files for MSVC port
 builtin-apply.c                      |    3 +-
 compat/mingw.c                       |   20 +-
 compat/msvc.c                        |   35 +
 compat/msvc.h                        |  102 +++
 compat/regex/regex.c                 |    7 +-
 compat/snprintf.c                    |    2 +-
 compat/vcbuild/.gitignore            |    3 +
 compat/vcbuild/README                |   13 +
 compat/vcbuild/git/git.vcproj        |  197 +++++
 compat/vcbuild/include/arpa/inet.h   |    1 +
 compat/vcbuild/include/dirent.h      |  128 ++++
 compat/vcbuild/include/grp.h         |    1 +
 compat/vcbuild/include/inttypes.h    |    1 +
 compat/vcbuild/include/netdb.h       |    1 +
 compat/vcbuild/include/netinet/in.h  |    1 +
 compat/vcbuild/include/netinet/tcp.h |    1 +
 compat/vcbuild/include/pwd.h         |    1 +
 compat/vcbuild/include/sys/ioctl.h   |    1 +
 compat/vcbuild/include/sys/param.h   |    1 +
 compat/vcbuild/include/sys/poll.h    |    1 +
 compat/vcbuild/include/sys/select.h  |    1 +
 compat/vcbuild/include/sys/socket.h  |    1 +
 compat/vcbuild/include/sys/time.h    |    1 +
 compat/vcbuild/include/sys/utime.h   |   34 +
 compat/vcbuild/include/sys/wait.h    |    1 +
 compat/vcbuild/include/unistd.h      |   92 +++
 compat/vcbuild/include/utime.h       |    1 +
 compat/vcbuild/libgit/libgit.vcproj  | 1359 ++++++++++++++++++++++++++++++++++
 compat/win32.h                       |    5 +
 compat/winansi.c                     |    2 +
 git-compat-util.h                    |    3 +
 help.c                               |    5 +-
 pager.c                              |    4 +-
 run-command.c                        |   12 +-
 run-command.h                        |    2 +-
 setup.c                              |    2 +-
 36 files changed, 2020 insertions(+), 25 deletions(-)
 create mode 100644 compat/msvc.c
 create mode 100644 compat/msvc.h
 create mode 100644 compat/vcbuild/.gitignore
 create mode 100644 compat/vcbuild/README
 create mode 100644 compat/vcbuild/git/git.vcproj
 create mode 100644 compat/vcbuild/include/arpa/inet.h
 create mode 100644 compat/vcbuild/include/dirent.h
 create mode 100644 compat/vcbuild/include/grp.h
 create mode 100644 compat/vcbuild/include/inttypes.h
 create mode 100644 compat/vcbuild/include/netdb.h
 create mode 100644 compat/vcbuild/include/netinet/in.h
 create mode 100644 compat/vcbuild/include/netinet/tcp.h
 create mode 100644 compat/vcbuild/include/pwd.h
 create mode 100644 compat/vcbuild/include/sys/ioctl.h
 create mode 100644 compat/vcbuild/include/sys/param.h
 create mode 100644 compat/vcbuild/include/sys/poll.h
 create mode 100644 compat/vcbuild/include/sys/select.h
 create mode 100644 compat/vcbuild/include/sys/socket.h
 create mode 100644 compat/vcbuild/include/sys/time.h
 create mode 100644 compat/vcbuild/include/sys/utime.h
 create mode 100644 compat/vcbuild/include/sys/wait.h
 create mode 100644 compat/vcbuild/include/unistd.h
 create mode 100644 compat/vcbuild/include/utime.h
 create mode 100644 compat/vcbuild/libgit/libgit.vcproj
Next: Marius Storm-Olsen
Message 1 of 49 in “Build git with MSVC”
  1. 00/14 Build git with MSVCMarius Storm-Olsen, Aug 21, 2009
  2. 01/14 Fix non-constant array creationMarius Storm-Olsen, Aug 21, 2009
  3. 02/14 Avoid declaration after statementMarius Storm-Olsen, Aug 21, 2009
  4. 03/14 Define SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++Marius Storm-Olsen, Aug 21, 2009
  5. 04/14 Add define guards to compat/win32.hMarius Storm-Olsen, Aug 21, 2009
  6. 05/14 Change regerror() declaration from K&R style to ANSI C (C89)Marius Storm-Olsen, Aug 21, 2009
  7. 06/14 mingw.c: Use the O_BINARY flag to open filesMarius Storm-Olsen, Aug 21, 2009
  8. 07/14 Fix __stdcall/WINAPI placement and function prototypeMarius Storm-Olsen, Aug 21, 2009
  9. 08/14 Test for WIN32 instead of __MINGW32_Marius Storm-Olsen, Aug 21, 2009
  10. 09/14 Avoid including windows.h in winansi.c for MSVC buildMarius Storm-Olsen, Aug 21, 2009
  11. 10/14 Add empty header files for MSVC portMarius Storm-Olsen, Aug 21, 2009
  12. 11/14 Add MinGW header files to build git with MSVCMarius Storm-Olsen, Aug 21, 2009
  13. 12/14 Add platform files for MSVC portingMarius Storm-Olsen, Aug 21, 2009
  14. 13/14 Add MSVC project filesMarius Storm-Olsen, Aug 21, 2009
  15. 14/14 Add README and gitignore file for MSVC buildMarius Storm-Olsen, Aug 21, 2009
  16. Thiago FarinaAug 23, 2009
  17. Reece DunnAug 23, 2009
  18. Marius Storm-OlsenAug 23, 2009
  19. Thiago FarinaAug 23, 2009
  20. Marius Storm-OlsenAug 24, 2009
  21. Frank LiAug 25, 2009
  22. Thiago FarinaAug 25, 2009
  23. Frank LiAug 27, 2009
  24. Thiago FarinaAug 27, 2009
  25. Erik Faye-LundSep 7, 2009
  26. Junio C HamanoAug 21, 2009
  27. Reece DunnAug 21, 2009
  28. Marius Storm-OlsenAug 22, 2009
  29. Paolo BonziniAug 28, 2009
  30. Johannes SixtAug 21, 2009
  31. Marius Storm-OlsenAug 21, 2009
  32. Frank LiAug 21, 2009
  33. 05/14 Change regerror() definition from K&R style to ANSI C (C89)Marius Storm-Olsen, Aug 21, 2009
  34. Frank LiAug 22, 2009
  35. Erik Faye-LundAug 24, 2009
  36. Junio C HamanoAug 21, 2009
  37. Johan 't HartAug 21, 2009
  38. Johannes SixtAug 21, 2009
  39. Junio C HamanoAug 21, 2009
  40. Marius Storm-OlsenAug 22, 2009
  41. Marius Storm-OlsenAug 22, 2009
  42. Erik Faye-LundAug 21, 2009
  43. Marius Storm-OlsenAug 21, 2009
  44. Janos LaubeAug 21, 2009
  45. Marius Storm-OlsenAug 21, 2009
  46. Johan 't HartAug 21, 2009
  47. Erik Faye-LundAug 22, 2009
  48. Junio C HamanoAug 21, 2009
  49. Junio C HamanoAug 21, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.