Skip to content

Commit 038354b

Browse files
committed
Import GnuWin32 patch for Windows 2.5.9-6
1 parent 01149f5 commit 038354b

File tree

13 files changed

+1783
-1697
lines changed

13 files changed

+1783
-1697
lines changed
File renamed without changes.
File renamed without changes.

src/patch/2.5.9/patch-2.5.9-src/Makefile.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
#### Start of system configuration section. ####
2222

2323
srcdir = @srcdir@
24-
VPATH = @srcdir@
2524
resdir = @top_builddir@res
26-
vpath %.rc @top_builddir@res
25+
VPATH = @srcdir@ @srcdir@/pc $(resdir)
2726

2827
@SET_MAKE@
2928

@@ -90,7 +89,7 @@ OBJS = patch-res.o $(LIBOBJS) \
9089
patch.$(OBJEXT) pch.$(OBJEXT) \
9190
quote.$(OBJEXT) quotearg.$(OBJEXT) quotesys.$(OBJEXT) \
9291
util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT) hash.$(OBJEXT) \
93-
pc_quote.$(OBJEXT)
92+
pc_quote.$(OBJEXT) rename.$(OBJEXT)
9493
HDRS = argmatch.h backupfile.h common.h dirname.h \
9594
error.h getopt.h gettext.h \
9695
inp.h maketime.h partime.h pch.h \

src/patch/2.5.9/patch-2.5.9-src/common.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@
3535
#include <time.h>
3636

3737
#include <sys/stat.h>
38+
#ifdef _WIN32
39+
# define _stat _stati64
40+
# define stat _stati64
41+
# define _fstat _fstati64
42+
# define fstat _fstati64
43+
# define off_t __int64
44+
#endif /* _WIN32 */
3845
#if ! defined S_ISDIR && defined S_IFDIR
3946
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
4047
#endif
@@ -237,6 +244,16 @@ void *realloc ();
237244
#ifndef STDERR_FILENO
238245
#define STDERR_FILENO 2
239246
#endif
247+
#ifdef __MINGW32__
248+
# define fseek fseeko64
249+
# define fseeko fseeko64
250+
# define lseek _lseeki64
251+
# define lseek64 _lseeki64
252+
# define ftell ftello64
253+
# define ftell64 ftello64
254+
# define tell _telli64
255+
# define tell64 _telli64
256+
#endif
240257
#if HAVE_FSEEKO
241258
typedef off_t file_offset;
242259
# define file_seek fseeko
@@ -303,3 +320,14 @@ void *realloc ();
303320
#define TTY_DEVICE (_fileno(stdout))
304321
#endif /* _WIN32 */
305322
#endif
323+
324+
#ifdef _WIN32
325+
# ifdef MKDIR_TAKES_ONE_ARG
326+
# undefine MKDIR_TAKES_ONE_ARG
327+
# endif
328+
# ifdef mkdir
329+
# undef mkdir
330+
# endif
331+
# define mkdir(name, mode) ((_mkdir) (name))
332+
# define rename(old,new) w32_rename(old,new)
333+
#endif /* _WIN32 */

src/patch/2.5.9/patch-2.5.9-src/patch.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ main (int argc, char **argv)
319319
}
320320
}
321321
}
322-
printf ("got_hunk = %ld\n", got_hunk);
323-
324322
if (!skip_rest_of_patch)
325323
{
326324
if (got_hunk < 0 && using_plan_a)
@@ -338,7 +336,6 @@ main (int argc, char **argv)
338336
}
339337

340338
/* Finish spewing out the new file. */
341-
printf ("hunk = %ld\n", hunk);
342339
assert (hunk);
343340
if (! spew_output (&outstate))
344341
{
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* Copyright (C) 2006 Free Software Foundation, Inc.
2+
This file is part of the GNU C Library.
3+
4+
The GNU C Library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
The GNU C Library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with the GNU C Library; if not, write to the Free
16+
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17+
02111-1307 USA. */
18+
19+
#include <stdio.h>
20+
#include <errno.h>
21+
#include <unistd.h>
22+
#include <windows.h>
23+
24+
/* Rename the file OLD to NEW. */
25+
int
26+
w32_rename (old, new)
27+
const char *old;
28+
const char *new;
29+
{
30+
if (old == NULL || new == NULL) {
31+
errno = EINVAL;
32+
return -1;
33+
}
34+
35+
if (!_access (new, F_OK))
36+
unlink (new);
37+
return rename (old, new);
38+
}
39+

src/patch/2.5.9/patch-2.5.9/Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
#### Start of system configuration section. ####
2222

2323
srcdir = ../patch-2.5.9-src
24-
VPATH = ../patch-2.5.9-src
2524
resdir = res
26-
vpath %.rc res
25+
VPATH = ../patch-2.5.9-src ../patch-2.5.9-src/pc $(resdir)
2726

2827

2928

@@ -34,13 +33,13 @@ INSTALL_PROGRAM = /bin/install.exe -cp
3433
INSTALL_DATA = /bin/install.exe -cp
3534
transform = s,$$,,;s,^,,;s/i386-pc-mingw32//
3635

37-
CFLAGS = -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -mcpu=i686 -ffast-math
38-
CPPFLAGS = -D__GW32__ -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -idirafter D:/Progra~1/GnuWin32/include -idirafter g:/glibc/include
36+
CFLAGS = -Wall -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -ffast-math
37+
CPPFLAGS = -D__GW32__ -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -idirafter D:/Progra~1/GnuWin32/include -Ig:/winx/include
3938
DEFS = -DINSTALLDIR=\"$(prefix)\" -DINSTALLDIR=\"$(prefix)\" -DINSTALLDIR=\"$(prefix)\" -DINSTALLDIR=\"$(prefix)\" -DHAVE_CONFIG_H
4039
EXEEXT = .exe
4140
LDFLAGS = -Wl,-s -Wl,--force-exe-suffix -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--allow-multiple-definition -Wl,--enable-stdcall-fixup -LD:/Progra~1/GnuWin32/lib -Wl,--major-image-version=$(MAJOR) -Wl,--minor-image-version=$(MINOR)
42-
LIBOBJS =
43-
LIBS = -Wl,-s -LD:/Progra~1/GnuWin32/lib -lgw32c -liberty -lintl -lwsock32 -lole32 -luuid -lmsvcp60
41+
LIBOBJS = error$U.o
42+
LIBS = -Wl,-s -LD:/Progra~1/GnuWin32/lib -liberty -lintl -lwsock32 -lole32 -luuid -lmsvcp60
4443
OBJEXT = o
4544
PACKAGE_NAME = patch
4645
PACKAGE_VERSION = 2.5.9
@@ -90,7 +89,7 @@ OBJS = patch-res.o $(LIBOBJS) \
9089
patch.$(OBJEXT) pch.$(OBJEXT) \
9190
quote.$(OBJEXT) quotearg.$(OBJEXT) quotesys.$(OBJEXT) \
9291
util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT) hash.$(OBJEXT) \
93-
pc_quote.$(OBJEXT)
92+
pc_quote.$(OBJEXT) rename.$(OBJEXT)
9493
HDRS = argmatch.h backupfile.h common.h dirname.h \
9594
error.h getopt.h gettext.h \
9695
inp.h maketime.h partime.h pch.h \

0 commit comments

Comments
 (0)