Make mingw branch compile on Linux again

This commit is contained in:
Johannes Sixt
2007-05-20 21:25:49 +02:00
parent bd26a0c75b
commit d17b18abec
4 changed files with 21 additions and 12 deletions

View File

@@ -209,8 +209,7 @@ SCRIPT_SH = \
git-applymbox.sh git-applypatch.sh git-am.sh \
git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
git-merge-resolve.sh git-merge-ours.sh \
git-lost-found.sh git-quiltimport.sh \
cpio.sh
git-lost-found.sh git-quiltimport.sh
SCRIPT_PERL = \
git-add--interactive.perl \
@@ -504,6 +503,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
X = .exe
NOEXECTEMPL = .noexec
template_dir = ../share/git-core/templates/
SCRIPT_SH += cpio.sh
endif
ifneq (,$(findstring arm,$(uname_M)))
ARM_SHA1 = YesPlease

View File

@@ -48,16 +48,20 @@
#include <sys/time.h>
#include <time.h>
#include <signal.h>
//#include <sys/wait.h>
#include <fnmatch.h>
//#include <sys/poll.h>
//#include <sys/socket.h>
//#include <sys/select.h>
#ifndef __MINGW32__
#include <sys/wait.h>
#include <sys/poll.h>
#include <sys/socket.h>
#include <sys/select.h>
#endif
#include <assert.h>
#include <regex.h>
//#include <netinet/in.h>
//#include <netinet/tcp.h>
//#include <arpa/inet.h>
#ifndef __MINGW32__
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#endif
#ifndef NO_ETC_PASSWD
#include <netdb.h>
#include <pwd.h>
@@ -345,7 +349,7 @@ static inline int strtoul_ui(char const *s, int base, unsigned int *result)
return 0;
}
// MinGW
#ifdef __MINGW32__
#ifndef S_ISLNK
#define S_IFLNK 0120000 /* Symbolic link */
@@ -459,4 +463,6 @@ int mingw_socket(int domain, int type, int protocol);
extern void quote_argv(const char **dst, const char **src);
extern const char *parse_interpreter(const char *cmd);
#endif /* __MINGW32__ */
#endif

View File

@@ -78,11 +78,11 @@ const char *prefix_path(const char *prefix, int len, const char *path)
const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)
{
static char path[PATH_MAX];
char *p;
#ifndef __MINGW32__
if (!pfx || !*pfx || arg[0] == '/')
return arg;
#else
char *p;
/* don't add prefix to absolute paths */
const int is_absolute =
is_dir_sep(arg[0]) ||

View File

@@ -106,12 +106,15 @@ static char *path_lookup(const char *cmd, char **path)
int spawnvpe_pipe(const char *cmd, const char **argv, const char **env,
int pin[], int pout[])
{
#ifdef __MINGW32__
char **path = get_path_split();
pid_t pid = spawnvppe_pipe(cmd, argv, env, path, pin, pout);
free_path_split(path);
#else
pid_t pid = spawnvppe_pipe(cmd, argv, env, NULL, pin, pout);
#endif
return pid;
}