From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Frank Li <lznuaa@gmail.com>
Cc: git@vger.kernel.org, msysgit@googlegroups.com
Subject: Re: [PATCH 09/11] Add MSVC porting header files.
Date: Mon, 17 Aug 2009 19:09:57 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.1.00.0908171902300.4991@intel-tinevez-2-302> (raw)
In-Reply-To: <1250525103-5184-4-git-send-email-lznuaa@gmail.com>
Hi,
On Tue, 18 Aug 2009, Frank Li wrote:
> Add unix head file, dirent.h, unistd.h and time.h
These are copied from somewhere. From where? What is the license?
> Add MSVC special porting head file msvc.h and msvc.c.
This is added by you. Logically, that should be a separate patch.
> diff --git a/compat/msvc.h b/compat/msvc.h
> new file mode 100644
> index 0000000..6071565
> --- /dev/null
> +++ b/compat/msvc.h
> @@ -0,0 +1,95 @@
> +#ifndef __MSVC__HEAD
> +#define __MSVC__HEAD
> +
> +#define WINVER 0x0500
> +#define _WIN32_WINNT 0x0500
> +#define _WIN32_WINDOWS 0x0410
> +#define _WIN32_IE 0x0700
> +#define NTDDI_VERSION NTDDI_WIN2KSP1
> +#include <winsock2.h>
> +
> +/*Configuration*/
> +
> +#define NO_PREAD
> +#define NO_OPENSSL
> +#define NO_LIBGEN_H
> +#define NO_SYMLINK_HEAD
> +#define NO_IPV6
> +#define NO_SETENV
> +#define NO_UNSETENV
> +#define NO_STRCASESTR
> +#define NO_STRLCPY
> +#define NO_MEMMEM
> +#define NO_C99_FORMAT
> +#define NO_STRTOUMAX
> +#define NO_MKDTEMP
> +#define NO_MKSTEMPS
> +
> +#define RUNTIME_PREFIX
> +#define NO_ST_BLOCKS_IN_STRUCT_STAT
> +#define NO_NSEC
> +#define USE_WIN32_MMAP
> +#define USE_NED_ALLOCATOR
> +
> +#define NO_REGEX
> +
> +#define NO_SYS_SELECT_H
> +#define NO_PTHEADS
> +#define HAVE_STRING_H 1
> +#define STDC_HEADERS
> +#define NO_ICONV
These would normally be defined in the Makefile. You might want to state
that in a comment.
Or maybe move the definitions (along with vsnprintf) to the .vcproj file,
which is the logical pendant of the Makefile?
> +#define inline __inline
> +#define __inline__ __inline
These definitions are unrelated to the surrounding ones; please move them
elsewhere.
> +
> +#define SNPRINTF_RETURNS_BOGUS
> +
> +#define SHA1_HEADER "mozilla-sha1\\sha1.h"
> +
> +#define ETC_GITCONFIG "%HOME%"
> +
> +#define NO_PTHREADS
> +#define NO_CURL
> +
> +
> +#define NO_STRTOUMAX
> +#define REGEX_MALLOC
> +
> +
> +#define GIT_EXEC_PATH "bin"
> +#define GIT_VERSION "1.6"
> +#define BINDIR "bin"
> +#define PREFIX "."
> +#define GIT_MAN_PATH "man"
> +#define GIT_INFO_PATH "info"
> +#define GIT_HTML_PATH "html"
> +#define DEFAULT_GIT_TEMPLATE_DIR "templates"
> +
> +#define NO_STRLCPY
> +#define NO_UNSETENV
> +#define NO_SETENV
Would these NO_ definitions not _love_ to be close to their siblings?
What is the reason for those empty lines? Their placement and amount look
rather arbitrary to me.
> +#define strdup _strdup
> +#define read _read
> +#define close _close
> +#define dup _dup
> +#define dup2 _dup2
> +#define strncasecmp _strnicmp
> +#define strtoull _strtoui64
vsnprintf could go right here.
> +#define __attribute__(x)
The two inline definitions could go right here.
> +static __inline int strcasecmp (const char *s1, const char *s2)
> +{
> + int size1=strlen(s1);
> + int sisz2=strlen(s2);
> +
> + return _strnicmp(s1,s2,sisz2>size1?sisz2:size1);
> +}
> +
> +#include "compat/mingw.h"
> +#undef ERROR
> +#undef stat
> +#define stat(x,y) mingw_lstat
> +#define stat _stat64
> +#endif
Looks much nicer now, thanks!
Ciao,
Dscho
next prev parent reply other threads:[~2009-08-17 17:10 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-17 16:04 [PATCH 06/11] Add miss git-compat-util.h at regex.c and fnmatch.c Add git-compat-util.h to enable build at MSVC environment Frank Li
2009-08-17 16:04 ` [PATCH 07/11] Add O_BINARY flag to open flag at mingw.c Frank Li
2009-08-17 16:04 ` [PATCH 08/11] Place __stdcall to correct position Frank Li
2009-08-17 16:05 ` [PATCH 09/11] Add MSVC porting header files Frank Li
2009-08-17 16:05 ` [PATCH 10/11] Add MSVC Project file Frank Li
2009-08-17 17:11 ` Johannes Schindelin
2009-08-17 17:34 ` Paolo Bonzini
2009-08-17 17:40 ` Erik Faye-Lund
2009-08-17 18:16 ` Paolo Bonzini
2009-08-17 19:53 ` Johannes Schindelin
2009-08-17 20:02 ` Paolo Bonzini
2009-08-17 20:54 ` Johannes Schindelin
2009-08-17 20:17 ` Pau Garcia i Quiles
2009-08-17 20:43 ` Reece Dunn
2009-08-17 20:54 ` Pau Garcia i Quiles
2009-08-17 21:05 ` Reece Dunn
2009-08-17 22:17 ` Johan 't Hart
2009-08-17 21:05 ` Johannes Schindelin
2009-08-17 21:23 ` Pau Garcia i Quiles
2009-08-17 22:10 ` Johannes Schindelin
2009-08-17 22:19 ` Pau Garcia i Quiles
2009-08-17 22:21 ` Paolo Bonzini
2009-08-17 22:32 ` Thiago Farina
2009-08-17 22:33 ` Thiago Farina
2009-08-17 20:56 ` Johannes Schindelin
2009-08-17 20:59 ` Pau Garcia i Quiles
2009-08-17 21:11 ` Johannes Schindelin
2009-08-17 22:26 ` Johan 't Hart
2009-08-17 23:00 ` Pau Garcia i Quiles
2009-08-17 23:40 ` Johannes Schindelin
2009-08-17 22:44 ` Pau Garcia i Quiles
2009-08-18 12:58 ` [RFC] Enable compilation by Makefile for the MSVC toolchain Marius Storm-Olsen
2009-08-18 13:01 ` Marius Storm-Olsen
2009-08-18 13:09 ` Erik Faye-Lund
2009-08-18 14:11 ` Johannes Schindelin
2009-08-18 17:07 ` Pau Garcia i Quiles
2009-08-18 21:35 ` Johannes Schindelin
2009-08-18 17:55 ` Marius Storm-Olsen
2009-08-18 18:42 ` Daniel Barkalow
2009-08-18 21:57 ` Johannes Schindelin
2009-08-19 9:58 ` Johannes Schindelin
2009-08-18 16:22 ` Johan 't Hart
2009-08-18 16:28 ` Reece Dunn
2009-08-18 17:06 ` Pau Garcia i Quiles
2009-08-18 17:44 ` Paolo Bonzini
2009-08-18 16:51 ` Junio C Hamano
2009-08-18 17:36 ` Marius Storm-Olsen
2009-08-18 17:41 ` Johan 't Hart
2009-08-18 18:06 ` Marius Storm-Olsen
2009-08-18 21:53 ` Johannes Schindelin
2009-08-18 22:02 ` Erik Faye-Lund
2009-08-18 22:38 ` Johannes Schindelin
2009-08-18 22:48 ` Erik Faye-Lund
2009-08-19 7:16 ` Johannes Schindelin
2009-08-19 7:29 ` Marius Storm-Olsen
2009-08-19 8:29 ` Johannes Schindelin
2009-08-19 8:56 ` Thomas Berg
2009-08-19 10:59 ` [msysGit] " Marius Storm-Olsen
2009-08-19 12:56 ` Johannes Schindelin
2009-08-19 13:26 ` Marius Storm-Olsen
2009-08-19 14:51 ` Erik Faye-Lund
2009-08-19 13:04 ` Joshua Jensen
2009-08-18 16:51 ` Daniel Barkalow
2009-08-18 17:38 ` Marius Storm-Olsen
2009-08-17 22:27 ` [PATCH 10/11] Add MSVC Project file Thiago Farina
2009-08-17 22:29 ` Thiago Farina
2009-08-17 22:39 ` Johannes Schindelin
2009-08-17 22:50 ` Thiago Farina
2009-08-17 17:09 ` Johannes Schindelin [this message]
2009-08-17 19:31 ` [PATCH 09/11] Add MSVC porting header files Pau Garcia i Quiles
2009-08-17 19:48 ` CMake, was " Johannes Schindelin
2009-08-17 19:51 ` Pau Garcia i Quiles
2009-08-17 19:54 ` Pau Garcia i Quiles
2009-08-17 20:58 ` Johannes Schindelin
2009-08-17 21:03 ` Pau Garcia i Quiles
2009-08-17 21:20 ` Reece Dunn
2009-08-17 21:29 ` Pau Garcia i Quiles
2009-08-17 20:07 ` [msysGit] " Johannes Sixt
2009-08-18 2:15 ` Frank Li
2009-08-18 9:47 ` Johannes Schindelin
2009-08-18 10:42 ` Junio C Hamano
2009-08-18 13:01 ` Johannes Schindelin
2009-08-17 19:21 ` [msysGit] " Johannes Sixt
2009-08-17 17:01 ` [PATCH 08/11] Place __stdcall to correct position Johannes Schindelin
2009-08-18 1:51 ` Frank Li
2009-08-18 9:36 ` Johannes Schindelin
2009-08-17 16:58 ` [PATCH 07/11] Add O_BINARY flag to open flag at mingw.c Johannes Schindelin
2009-08-18 2:02 ` Frank Li
2009-08-18 9:40 ` Johannes Schindelin
2009-08-17 16:51 ` [PATCH 06/11] Add miss git-compat-util.h at regex.c and fnmatch.c Add git-compat-util.h to enable build at MSVC environment Johannes Schindelin
2009-08-17 19:23 ` Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.1.00.0908171902300.4991@intel-tinevez-2-302 \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=lznuaa@gmail.com \
--cc=msysgit@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).