aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorTom Tromey2013-06-03 12:25:05 -0600
committerTom Tromey2013-06-03 12:25:05 -0600
commit68359abba96d7ec4db8aab3d3dd9cf1105c3bab5 (patch)
tree862703e7e1a1888170136a8296a5750d6b2ae2eb /lib-src
parentcbcba8ce7f980b01c18c0fd561ef6687b1361507 (diff)
parente2d8a6f0a229b4ebe26484b892ec4f14888f58b6 (diff)
downloademacs-68359abba96d7ec4db8aab3d3dd9cf1105c3bab5.tar.gz
emacs-68359abba96d7ec4db8aab3d3dd9cf1105c3bab5.zip
merge from trunk; clean up some issues
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog60
-rw-r--r--lib-src/Makefile.in85
-rw-r--r--lib-src/etags.c13
-rw-r--r--lib-src/make-docfile.c3
-rw-r--r--lib-src/makefile.w32-in6
-rw-r--r--lib-src/ntlib.c16
-rw-r--r--lib-src/ntlib.h4
-rw-r--r--lib-src/pop.c36
-rw-r--r--lib-src/update-game-score.c4
9 files changed, 155 insertions, 72 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 0d7a0a4591e..e1025fc5f6b 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,13 +1,63 @@
12013-05-29 Eli Zaretskii <eliz@gnu.org>
2
3 * Makefile.in (mostlyclean): Remove *.res files.
4
52013-05-18 Paul Eggert <eggert@cs.ucla.edu>
6
7 Port --enable-gcc-warnings to clang.
8 * etags.c: Omit unnecessary forward decls.
9 (print_version, print_help): Declare _Noreturn.
10 * pop.c (socket_connection) [HAVE_GETADDRINFO]: Simplify.
11
122013-05-16 Eli Zaretskii <eliz@gnu.org>
13
14 * update-game-score.c [WINDOWSNT]: Include "ntlib.h".
15
16 * ntlib.h (sleep): Update prototype.
17 (geteuid): Add prototype.
18
19 * ntlib.c (sleep): Now returns an unsigned value.
20 (getgid): New function.
21
22 * Makefile.in (CLIENTW, LIB_WSOCK32, LIBS_ECLIENT, NTLIB)
23 (CLIENTRES, WINDRES, NTINC, NTDEPS): New variables.
24 (INSTALLABLES): Add $(CLIENTW).
25 (LIBS_MOVE): Use $(LIB_WSOCK32).
26 ($(DESTDIR)${archlibdir}): Use $(EXEEXT) on update-game-score.
27 (test-distrib${EXEEXT}): Use $(EXEEXT) on test-distrib.
28 (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT})
29 (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT})
30 (emacsclient${EXEEXT}, hexl${EXEEXT}, update-game-score${EXEEXT}):
31 Add $(NTLIB) to prerequisites. Use $(EXEEXT).
32 (pop.o): Add pop.h to prerequisites.
33 (emacsclientw${EXEEXT}, ntlib.o): New targets.
34 (emacsclient.res): New target.
35
362013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
37
38 * makefile.w32-in ($(DOC)): Use DOC rather than DOC-X.
39
402013-05-06 Paul Eggert <eggert@cs.ucla.edu>
41
42 * make-docfile.c (search_lisp_doc_at_eol) [DEBUG]: Fix typo,
43 by removing references to no-longer-existing locals.
44
452013-03-26 Eli Zaretskii <eliz@gnu.org>
46
47 Fix incompatibilities between MinGW.org and MinGW64 headers.
48 * ntlib.c (struct timespec) [!_TIMEZONE_DEFINED]: Define the
49 struct only if _TIMEZONE_DEFINED is not defined.
50
512013-03-23 cg <chengang31@gmail.com> (tiny change)
52
53 * makefile.w32-in (LIB_SRC): Move before first use.
54
12013-03-16 Paul Eggert <eggert@cs.ucla.edu> 552013-03-16 Paul Eggert <eggert@cs.ucla.edu>
2 56
3 * pop.c: Fix ERRMAX typo (Bug#13925). 57 * pop.c: Fix ERRMAX typo (Bug#13925).
4 (socket_connection) [!HAVE_KRB5_ERROR_TEXT && HAVE_KRB5_ERROR_E_TEXT]: 58 (socket_connection) [!HAVE_KRB5_ERROR_TEXT && HAVE_KRB5_ERROR_E_TEXT]:
5 Use ERROR_MAX, not ERRMAX. 59 Use ERROR_MAX, not ERRMAX.
6 60
72013-03-16 Glenn Morris <rgm@gnu.org>
8
9 * Version 24.3 released.
10
112013-03-13 Paul Eggert <eggert@cs.ucla.edu> 612013-03-13 Paul Eggert <eggert@cs.ucla.edu>
12 62
13 File synchronization fixes (Bug#13944). 63 File synchronization fixes (Bug#13944).
@@ -3718,7 +3768,7 @@
3718 3768
37192002-03-05 Francesco Potortì <pot@gnu.org> 37692002-03-05 Francesco Potortì <pot@gnu.org>
3720 3770
3721 * etags.c: Honour #line directives. 3771 * etags.c: Honor #line directives.
3722 (no_line_directive): New global var; set it for old behavior. 3772 (no_line_directive): New global var; set it for old behavior.
3723 (main): Remove some #ifdef in the getopt switch. 3773 (main): Remove some #ifdef in the getopt switch.
3724 (add_node, put_entries): Code added to merge different chunks of 3774 (add_node, put_entries): Code added to merge different chunks of
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 7069af9767a..f32333fe765 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -113,8 +113,11 @@ MKDIR_P = @MKDIR_P@
113 113
114# ========================== Lists of Files =========================== 114# ========================== Lists of Files ===========================
115 115
116# emacsclientw.exe for MinGW, empty otherwise
117CLIENTW = @CLIENTW@
118
116# Things that a user might actually run, which should be installed in bindir. 119# Things that a user might actually run, which should be installed in bindir.
117INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \ 120INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} $(CLIENTW) \
118 ebrowse${EXEEXT} 121 ebrowse${EXEEXT}
119 122
120INSTALLABLE_SCRIPTS = grep-changelog 123INSTALLABLE_SCRIPTS = grep-changelog
@@ -163,10 +166,21 @@ LIBS_MAIL=@LIBS_MAIL@
163LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ 166LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
164## empty or -lrt or -lposix4 if HAVE_FDATASYNC 167## empty or -lrt or -lposix4 if HAVE_FDATASYNC
165LIB_FDATASYNC = @LIB_FDATASYNC@ 168LIB_FDATASYNC = @LIB_FDATASYNC@
169## empty or -lwsock2 for MinGW
170LIB_WSOCK32=@LIB_WSOCK32@
166 171
167## Extra libraries to use when linking movemail. 172## Extra libraries to use when linking movemail.
168LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ 173LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
169 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) 174 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32)
175
176## Extra libraries when linking emacsclient
177## (empty or -lcomctl32 for MinGW)
178LIBS_ECLIENT = @LIBS_ECLIENT@
179
180## Extra object files for linking for MinGW
181NTLIB = @NTLIB@
182CLIENTRES = @CLIENTRES@
183WINDRES = @WINDRES@
170 184
171## Some systems define this to request special libraries. 185## Some systems define this to request special libraries.
172LIBS_SYSTEM = @LIBS_SYSTEM@ 186LIBS_SYSTEM = @LIBS_SYSTEM@
@@ -227,7 +241,7 @@ $(DESTDIR)${archlibdir}: all
227 umask 022; ${MKDIR_P} $(DESTDIR)${gamedir}; \ 241 umask 022; ${MKDIR_P} $(DESTDIR)${gamedir}; \
228 touch $(DESTDIR)${gamedir}/snake-scores; \ 242 touch $(DESTDIR)${gamedir}/snake-scores; \
229 touch $(DESTDIR)${gamedir}/tetris-scores 243 touch $(DESTDIR)${gamedir}/tetris-scores
230 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \ 244 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score${EXEEXT} && chmod u+s $(DESTDIR)${archlibdir}/update-game-score${EXEEXT}; then \
231 chown ${gameuser} $(DESTDIR)${gamedir}; \ 245 chown ${gameuser} $(DESTDIR)${gamedir}; \
232 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \ 246 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
233 fi 247 fi
@@ -264,7 +278,7 @@ uninstall:
264 fi 278 fi
265 279
266mostlyclean: 280mostlyclean:
267 -rm -f core *.o 281 -rm -f core *.o *.res
268 282
269clean: mostlyclean 283clean: mostlyclean
270 -rm -f ${EXE_FILES} 284 -rm -f ${EXE_FILES}
@@ -292,7 +306,7 @@ TAGS: etags${EXEEXT}
292## distribute Emacs. If they were clobbered, all the .elc files were 306## distribute Emacs. If they were clobbered, all the .elc files were
293## clobbered too. 307## clobbered too.
294test-distrib${EXEEXT}: ${srcdir}/test-distrib.c 308test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
295 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c 309 $(CC) ${ALL_CFLAGS} -o test-distrib${EXEEXT} ${srcdir}/test-distrib.c
296 ./test-distrib ${srcdir}/testfile 310 ./test-distrib ${srcdir}/testfile
297 311
298../lib/libgnu.a: $(config_h) 312../lib/libgnu.a: $(config_h)
@@ -302,47 +316,68 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
302 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \ 316 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
303 ${srcdir}/../src/regex.c 317 ${srcdir}/../src/regex.c
304 318
305etags${EXEEXT}: ${srcdir}/etags.c regex.o $(config_h) 319etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
306 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \ 320 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
307 -DVERSION="\"${version}\"" ${srcdir}/etags.c \ 321 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
308 regex.o $(LOADLIBES) -o etags 322 regex.o $(LOADLIBES) $(NTLIB) -o etags${EXEEXT}
309 323
310ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(config_h) 324ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
325 $(config_h)
311 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ 326 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
312 ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse 327 ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o ebrowse${EXEEXT}
313 328
314## We depend on etags to assure that parallel makes do not write two 329## We depend on etags to assure that parallel makes do not write two
315## etags.o files on top of each other. 330## etags.o files on top of each other.
316ctags${EXEEXT}: etags${EXEEXT} 331ctags${EXEEXT}: etags${EXEEXT}
317 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \ 332 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
318 -DVERSION="\"${version}\"" ${srcdir}/etags.c \ 333 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
319 regex.o $(LOADLIBES) -o ctags 334 regex.o $(LOADLIBES) $(NTLIB) -o ctags${EXEEXT}
320 335
321profile${EXEEXT}: ${srcdir}/profile.c $(config_h) 336profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h)
322 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \ 337 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \
323 $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile 338 $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT}
324 339
325make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(config_h) 340make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
326 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \ 341 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) $(NTLIB) \
327 -o make-docfile 342 -o make-docfile${EXEEXT}
328 343
329movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(config_h) 344movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
330 $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \ 345 $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
331 $(LOADLIBES) $(LIBS_MOVE) -o movemail 346 $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o movemail${EXEEXT}
332 347
333pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h) 348pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
334 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c 349 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
335 350
336emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h) 351emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
337 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ 352 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
338 -DVERSION="\"${version}\"" \ 353 -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \
339 $(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient 354 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclient${EXEEXT}
355
356emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
357 $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows ${srcdir}/emacsclient.c \
358 -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \
359 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclientw${EXEEXT}
340 360
341hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h) 361NTINC = ${srcdir}/../nt/inc
342 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl 362NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \
363 $(NTINC)/stdint.h $(NTINC)/pwd.h $(NTINC)/sys/time.h $(NTINC)/stdbool.h \
364 $(NTINC)/sys/wait.h $(NTINC)/unistd.h $(NTINC)/sys/file.h $(NTINC)/netdb.h
343 365
344update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(config_h) 366# The dependency on $(NTDEPS) is a trick intended to cause recompile of
367# programs on MinGW whenever some private header in nt/inc is modified.
368ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS)
369 $(CC) -c ${CPP_CFLAGS} ${srcdir}/ntlib.c
370
371hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h)
372 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT}
373
374update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
345 $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ 375 $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
346 ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score 376 ${srcdir}/update-game-score.c $(LOADLIBES) $(NTLIB) \
377 -o update-game-score${EXEEXT}
378
379emacsclient.res: $(NTINC)/../emacsclient.rc
380 $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o emacsclient.res \
381 $(NTINC)/../emacsclient.rc
347 382
348## Makefile ends here. 383## Makefile ends here.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 27a853a954a..f6b173bf465 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -316,15 +316,7 @@ static void Texinfo_nodes (FILE *);
316static void Yacc_entries (FILE *); 316static void Yacc_entries (FILE *);
317static void just_read_file (FILE *); 317static void just_read_file (FILE *);
318 318
319static void print_language_names (void);
320static void print_version (void);
321static void print_help (argument *);
322int main (int, char **);
323
324static compressor *get_compressor_from_suffix (char *, char **);
325static language *get_language_from_langname (const char *); 319static language *get_language_from_langname (const char *);
326static language *get_language_from_interpreter (char *);
327static language *get_language_from_filename (char *, bool);
328static void readline (linebuffer *, FILE *); 320static void readline (linebuffer *, FILE *);
329static long readline_internal (linebuffer *, FILE *); 321static long readline_internal (linebuffer *, FILE *);
330static bool nocase_tail (const char *); 322static bool nocase_tail (const char *);
@@ -346,7 +338,6 @@ static void find_entries (FILE *);
346static void free_tree (node *); 338static void free_tree (node *);
347static void free_fdesc (fdesc *); 339static void free_fdesc (fdesc *);
348static void pfnote (char *, bool, char *, int, int, long); 340static void pfnote (char *, bool, char *, int, int, long);
349static void make_tag (const char *, int, bool, char *, int, int, long);
350static void invalidate_nodes (fdesc *, node **); 341static void invalidate_nodes (fdesc *, node **);
351static void put_entries (node *); 342static void put_entries (node *);
352 343
@@ -816,7 +807,7 @@ etags --help --lang=ada.");
816#ifndef VERSION 807#ifndef VERSION
817# define VERSION "17.38.1.4" 808# define VERSION "17.38.1.4"
818#endif 809#endif
819static void 810static _Noreturn void
820print_version (void) 811print_version (void)
821{ 812{
822 char emacs_copyright[] = COPYRIGHT; 813 char emacs_copyright[] = COPYRIGHT;
@@ -832,7 +823,7 @@ print_version (void)
832# define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE 823# define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE
833#endif 824#endif
834 825
835static void 826static _Noreturn void
836print_help (argument *argbuffer) 827print_help (argument *argbuffer)
837{ 828{
838 bool help_for_lang = FALSE; 829 bool help_for_lang = FALSE;
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 68e5279fd15..8fa70dd430e 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -1090,8 +1090,7 @@ search_lisp_doc_at_eol (FILE *infile)
1090 if (c2 != '"' || c1 != '\\') 1090 if (c2 != '"' || c1 != '\\')
1091 { 1091 {
1092#ifdef DEBUG 1092#ifdef DEBUG
1093 fprintf (stderr, "## non-docstring in %s (%s)\n", 1093 fprintf (stderr, "## non-docstring found\n");
1094 buffer, filename);
1095#endif 1094#endif
1096 if (c != EOF) 1095 if (c != EOF)
1097 ungetc (c, infile); 1096 ungetc (c, infile);
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index 8d016bc16be..9656a3badec 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -27,6 +27,7 @@ LOCAL_FLAGS = -DNO_LDAV=1 -DNO_ARCHIVES=1 -I../lib \
27 -I../nt/inc -I../src $(EMACS_EXTRA_C_FLAGS) 27 -I../nt/inc -I../src $(EMACS_EXTRA_C_FLAGS)
28 28
29LIBS = $(BASE_LIBS) $(ADVAPI32) 29LIBS = $(BASE_LIBS) $(ADVAPI32)
30LIB_SRC = .
30 31
31# The following target is used by makefile.w32-in files in other directories. 32# The following target is used by makefile.w32-in files in other directories.
32make-docfile: $(BLD)/make-docfile.exe 33make-docfile: $(BLD)/make-docfile.exe
@@ -291,10 +292,10 @@ $(DOC): stamp_BLD $(BLD)/make-docfile.exe ../src/$(BLD)/temacs.exe $(lisp1) $(l
291 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1) 292 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1)
292 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2) 293 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2)
293 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(OTHER_PLATFORM_SUPPORT) 294 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(OTHER_PLATFORM_SUPPORT)
294 $(CP) $(DOC) ../etc/DOC-X 295 $(CP) $(DOC) ../etc/DOC
295 - mkdir "../src/$(OBJDIR)" 296 - mkdir "../src/$(OBJDIR)"
296 - mkdir "../src/$(OBJDIR)/etc" 297 - mkdir "../src/$(OBJDIR)/etc"
297 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC-X 298 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC
298 299
299{$(BLD)}.$(O){$(BLD)}.exe: 300{$(BLD)}.$(O){$(BLD)}.exe:
300 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS) 301 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
@@ -360,7 +361,6 @@ TAGS: $(BLD)/etags.exe *.c *.h
360### DEPENDENCIES ### 361### DEPENDENCIES ###
361 362
362EMACS_ROOT = .. 363EMACS_ROOT = ..
363LIB_SRC = .
364SRC = $(EMACS_ROOT)/src 364SRC = $(EMACS_ROOT)/src
365NT_INC = $(EMACS_ROOT)/nt/inc 365NT_INC = $(EMACS_ROOT)/nt/inc
366GNU_LIB = $(EMACS_ROOT)/lib 366GNU_LIB = $(EMACS_ROOT)/lib
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index f43117457cb..41b4e3a0cbc 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -34,21 +34,26 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
34 34
35#include "ntlib.h" 35#include "ntlib.h"
36 36
37/* MinGW64 defines _TIMEZONE_DEFINED and defines 'struct timespec' in
38 its system headers. */
39#ifndef _TIMEZONE_DEFINED
37struct timezone 40struct timezone
38{ 41{
39 int tz_minuteswest; /* minutes west of Greenwich */ 42 int tz_minuteswest; /* minutes west of Greenwich */
40 int tz_dsttime; /* type of dst correction */ 43 int tz_dsttime; /* type of dst correction */
41}; 44};
45#endif
42 46
43#define MAXPATHLEN _MAX_PATH 47#define MAXPATHLEN _MAX_PATH
44 48
45/* Emulate sleep...we could have done this with a define, but that 49/* Emulate sleep...we could have done this with a define, but that
46 would necessitate including windows.h in the files that used it. 50 would necessitate including windows.h in the files that used it.
47 This is much easier. */ 51 This is much easier. */
48void 52unsigned
49sleep (unsigned long seconds) 53sleep (unsigned seconds)
50{ 54{
51 Sleep (seconds * 1000); 55 Sleep (seconds * 1000);
56 return 0;
52} 57}
53 58
54/* Get the current working directory. */ 59/* Get the current working directory. */
@@ -134,6 +139,12 @@ getuid (void)
134} 139}
135 140
136unsigned 141unsigned
142geteuid (void)
143{
144 return getuid ();
145}
146
147unsigned
137getgid (void) 148getgid (void)
138{ 149{
139 return 0; 150 return 0;
@@ -411,4 +422,3 @@ lstat (const char * path, struct stat * buf)
411{ 422{
412 return stat (path, buf); 423 return stat (path, buf);
413} 424}
414
diff --git a/lib-src/ntlib.h b/lib-src/ntlib.h
index 1b2f57f35e5..3e48d2997e0 100644
--- a/lib-src/ntlib.h
+++ b/lib-src/ntlib.h
@@ -16,7 +16,6 @@ GNU General Public License for more details.
16You should have received a copy of the GNU General Public License 16You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19
20#include <pwd.h> 19#include <pwd.h>
21#include <malloc.h> 20#include <malloc.h>
22 21
@@ -29,12 +28,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29#ifdef sleep 28#ifdef sleep
30#undef sleep 29#undef sleep
31#endif 30#endif
32void sleep (unsigned long seconds); 31unsigned sleep (unsigned seconds);
33char *getwd (char *dir); 32char *getwd (char *dir);
34int getppid (void); 33int getppid (void);
35char * getlogin (void); 34char * getlogin (void);
36char * cuserid (char * s); 35char * cuserid (char * s);
37unsigned getuid (void); 36unsigned getuid (void);
37unsigned geteuid (void);
38unsigned getegid (void); 38unsigned getegid (void);
39unsigned getgid (void); 39unsigned getgid (void);
40int setuid (unsigned uid); 40int setuid (unsigned uid);
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 1f3f82baa68..a269144c915 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -1075,28 +1075,22 @@ socket_connection (char *host, int flags)
1075 } 1075 }
1076 } while (ret != 0); 1076 } while (ret != 0);
1077 1077
1078 if (ret == 0) 1078 for (it = res; it; it = it->ai_next)
1079 { 1079 if (it->ai_addrlen == sizeof addr)
1080 it = res; 1080 {
1081 while (it) 1081 struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr;
1082 { 1082 addr.sin_addr = in_a->sin_addr;
1083 if (it->ai_addrlen == sizeof (addr)) 1083 if (! connect (sock, (struct sockaddr *) &addr, sizeof addr))
1084 { 1084 break;
1085 struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr; 1085 }
1086 addr.sin_addr = in_a->sin_addr; 1086 connect_ok = it != NULL;
1087 if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) 1087 if (connect_ok)
1088 break; 1088 {
1089 } 1089 realhost = alloca (strlen (it->ai_canonname) + 1);
1090 it = it->ai_next; 1090 strcpy (realhost, it->ai_canonname);
1091 }
1092 connect_ok = it != NULL;
1093 if (connect_ok)
1094 {
1095 realhost = alloca (strlen (it->ai_canonname) + 1);
1096 strcpy (realhost, it->ai_canonname);
1097 }
1098 freeaddrinfo (res);
1099 } 1091 }
1092 freeaddrinfo (res);
1093
1100#else /* !HAVE_GETADDRINFO */ 1094#else /* !HAVE_GETADDRINFO */
1101 do 1095 do
1102 { 1096 {
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index 29c81a8936c..ec8b4317770 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -46,6 +46,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
46#include <sys/stat.h> 46#include <sys/stat.h>
47#include <getopt.h> 47#include <getopt.h>
48 48
49#ifdef WINDOWSNT
50#include "ntlib.h"
51#endif
52
49#define MAX_ATTEMPTS 5 53#define MAX_ATTEMPTS 5
50#define MAX_SCORES 200 54#define MAX_SCORES 200
51#define MAX_DATA_LEN 1024 55#define MAX_DATA_LEN 1024