aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorJoakim Verona2012-08-15 21:49:40 +0200
committerJoakim Verona2012-08-15 21:49:40 +0200
commitb648c26ec642a1dc58c0bd7e59d6011b964dbe37 (patch)
treef0f3b38ffa9054702f475fc53622e28da14f97b1 /lib-src
parentc8b0fc1999006af5a4317b44068fac13d9592143 (diff)
parent94c9ece10275f8ca9323c38f93607f1046035c79 (diff)
downloademacs-b648c26ec642a1dc58c0bd7e59d6011b964dbe37.tar.gz
emacs-b648c26ec642a1dc58c0bd7e59d6011b964dbe37.zip
upstream
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog51
-rw-r--r--lib-src/Makefile.in25
-rw-r--r--lib-src/ebrowse.c9
-rw-r--r--lib-src/emacsclient.c25
-rw-r--r--lib-src/etags.c2
-rw-r--r--lib-src/make-docfile.c62
-rw-r--r--lib-src/makefile.w32-in5
-rw-r--r--lib-src/movemail.c35
-rw-r--r--lib-src/ntlib.c19
-rw-r--r--lib-src/profile.c2
10 files changed, 121 insertions, 114 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index c5d6ed6eaf0..f3fd3751005 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,54 @@
12012-08-15 Paul Eggert <eggert@cs.ucla.edu>
2
3 * etags.c (Pascal_functions): Fix parenthesization typo.
4
52012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6
7 * make-docfile.c (enum global_type): Sort values roughly in
8 decreasing alignment, except put functions last.
9 (compare_globals): Use this new property of enum global_type.
10 (write_globals): Use bool, not int, for booleans.
11
122012-08-10 Glenn Morris <rgm@gnu.org>
13
14 * make-docfile.c (IF_LINT):
15 * emacsclient.c (IF_LINT): Remove (in config.h now).
16
17 * make-docfile.c (main):
18 (fopen) [!WINDOWSNT]:
19 (chdir) [!DOS_NT]: No more need to undef.
20
21 * movemail.c (DIRECTORY_SEP, IS_DIRECTORY_SEP):
22 * make-docfile.c (DIRECTORY_SEP, IS_DIRECTORY_SEP):
23 * emacsclient.c (DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP):
24 Remove (they are in config.h now).
25
26 * ebrowse.c (PATH_LIST_SEPARATOR):
27 Remove, and replace with SEPCHAR from config.h.
28
292012-08-03 Juanma Barranquero <lekktu@gmail.com>
30
31 * makefile.w32-in (LOCAL_FLAGS): Remove WINDOWSNT and DOS_NT,
32 they are always defined in config.h.
33
342012-08-03 Eli Zaretskii <eliz@gnu.org>
35
36 * ntlib.c (lstat): New function, calls 'stat'.
37
382012-08-02 Paul Eggert <eggert@cs.ucla.edu>
39
40 Use C99-style 'extern inline' if available.
41 * profile.c (SYSTIME_INLINE): Define.
42
432012-08-02 Glenn Morris <rgm@gnu.org>
44
45 * makefile.w32-in (MS_W32_H): Update for new ms-w32.h location.
46
472012-08-01 Glenn Morris <rgm@gnu.org>
48
49 * Makefile.in (config_h): New variable.
50 Use throughout in place of ../src/config.h.
51
12012-08-01 Juanma Barranquero <lekktu@gmail.com> 522012-08-01 Juanma Barranquero <lekktu@gmail.com>
2 53
3 * makefile.w32-in (CONFIG_H): Update dependencies. 54 * makefile.w32-in (CONFIG_H): Update dependencies.
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index a578966b0f0..c5acca28856 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -178,6 +178,9 @@ ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
178LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS} 178LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
179CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS} 179CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
180 180
181# Configuration files for .o files to depend on.
182config_h = ../src/config.h $(srcdir)/../src/conf_post.h
183
181all: ${EXE_FILES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} 184all: ${EXE_FILES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
182 185
183.PHONY: all need-blessmail maybe-blessmail 186.PHONY: all need-blessmail maybe-blessmail
@@ -289,19 +292,19 @@ test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
289 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c 292 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
290 ./test-distrib ${srcdir}/testfile 293 ./test-distrib ${srcdir}/testfile
291 294
292../lib/libgnu.a: ../src/config.h 295../lib/libgnu.a: $(config_h)
293 cd ../lib && $(MAKE) libgnu.a 296 cd ../lib && $(MAKE) libgnu.a
294 297
295regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h 298regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
296 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \ 299 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
297 ${srcdir}/../src/regex.c 300 ${srcdir}/../src/regex.c
298 301
299etags${EXEEXT}: ${srcdir}/etags.c regex.o ../src/config.h 302etags${EXEEXT}: ${srcdir}/etags.c regex.o $(config_h)
300 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \ 303 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
301 -DVERSION="\"${version}\"" ${srcdir}/etags.c \ 304 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
302 regex.o $(LOADLIBES) -o etags 305 regex.o $(LOADLIBES) -o etags
303 306
304ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h ../src/config.h 307ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(config_h)
305 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ 308 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
306 ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse 309 ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse
307 310
@@ -312,30 +315,30 @@ ctags${EXEEXT}: etags${EXEEXT}
312 -DVERSION="\"${version}\"" ${srcdir}/etags.c \ 315 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
313 regex.o $(LOADLIBES) -o ctags 316 regex.o $(LOADLIBES) -o ctags
314 317
315profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h 318profile${EXEEXT}: ${srcdir}/profile.c $(config_h)
316 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \ 319 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \
317 $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile 320 $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile
318 321
319make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h 322make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(config_h)
320 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \ 323 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
321 -o make-docfile 324 -o make-docfile
322 325
323movemail${EXEEXT}: ${srcdir}/movemail.c pop.o ../src/config.h 326movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(config_h)
324 $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \ 327 $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
325 $(LOADLIBES) $(LIBS_MOVE) -o movemail 328 $(LOADLIBES) $(LIBS_MOVE) -o movemail
326 329
327pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h ../src/config.h 330pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h)
328 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c 331 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
329 332
330emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h 333emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h)
331 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ 334 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
332 -DVERSION="\"${version}\"" \ 335 -DVERSION="\"${version}\"" \
333 $(LOADLIBES) -o emacsclient 336 $(LOADLIBES) -o emacsclient
334 337
335hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h 338hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h)
336 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl 339 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
337 340
338update-game-score${EXEEXT}: ${srcdir}/update-game-score.c ../src/config.h 341update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(config_h)
339 $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ 342 $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
340 ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score 343 ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score
341 344
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 1c43bc6a4f1..f8569fe3747 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -43,17 +43,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
43 43
44#define READ_CHUNK_SIZE (100 * 1024) 44#define READ_CHUNK_SIZE (100 * 1024)
45 45
46/* The character used as a separator in path lists (like $PATH). */
47
48#if defined (__MSDOS__) 46#if defined (__MSDOS__)
49#define PATH_LIST_SEPARATOR ';'
50#define FILENAME_EQ(X,Y) (strcasecmp (X,Y) == 0) 47#define FILENAME_EQ(X,Y) (strcasecmp (X,Y) == 0)
51#else 48#else
52#if defined (WINDOWSNT) 49#if defined (WINDOWSNT)
53#define PATH_LIST_SEPARATOR ';'
54#define FILENAME_EQ(X,Y) (stricmp (X,Y) == 0) 50#define FILENAME_EQ(X,Y) (stricmp (X,Y) == 0)
55#else 51#else
56#define PATH_LIST_SEPARATOR ':'
57#define FILENAME_EQ(X,Y) (streq (X,Y)) 52#define FILENAME_EQ(X,Y) (streq (X,Y))
58#endif 53#endif
59#endif 54#endif
@@ -3417,7 +3412,7 @@ add_search_path (char *path_list)
3417 char *start = path_list; 3412 char *start = path_list;
3418 struct search_path *p; 3413 struct search_path *p;
3419 3414
3420 while (*path_list && *path_list != PATH_LIST_SEPARATOR) 3415 while (*path_list && *path_list != SEPCHAR)
3421 ++path_list; 3416 ++path_list;
3422 3417
3423 p = (struct search_path *) xmalloc (sizeof *p); 3418 p = (struct search_path *) xmalloc (sizeof *p);
@@ -3434,7 +3429,7 @@ add_search_path (char *path_list)
3434 else 3429 else
3435 search_path = search_path_tail = p; 3430 search_path = search_path_tail = p;
3436 3431
3437 while (*path_list == PATH_LIST_SEPARATOR) 3432 while (*path_list == SEPCHAR)
3438 ++path_list; 3433 ++path_list;
3439 } 3434 }
3440} 3435}
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 0ba6535b79d..20afe1cad11 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1,5 +1,6 @@
1/* Client process that communicates with GNU Emacs acting as server. 1/* Client process that communicates with GNU Emacs acting as server.
2 Copyright (C) 1986-1987, 1994, 1999-2012 Free Software Foundation, Inc. 2
3Copyright (C) 1986-1987, 1994, 1999-2012 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -112,13 +113,6 @@ char *(getcwd) (char *, size_t);
112/* Additional space when allocating buffers for filenames, etc. */ 113/* Additional space when allocating buffers for filenames, etc. */
113#define EXTRA_SPACE 100 114#define EXTRA_SPACE 100
114 115
115/* Use this to suppress gcc's `...may be used before initialized' warnings. */
116#ifdef lint
117# define IF_LINT(Code) Code
118#else
119# define IF_LINT(Code) /* empty */
120#endif
121
122#ifdef min 116#ifdef min
123#undef min 117#undef min
124#endif 118#endif
@@ -213,21 +207,6 @@ xmalloc (size_t size)
213/* From sysdep.c */ 207/* From sysdep.c */
214#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME) 208#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME)
215 209
216/* From lisp.h */
217#ifndef DIRECTORY_SEP
218#define DIRECTORY_SEP '/'
219#endif
220#ifndef IS_DIRECTORY_SEP
221#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
222#endif
223#ifndef IS_DEVICE_SEP
224#ifndef DEVICE_SEP
225#define IS_DEVICE_SEP(_c_) 0
226#else
227#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP)
228#endif
229#endif
230
231char *get_current_dir_name (void); 210char *get_current_dir_name (void);
232 211
233/* Return the current working directory. Returns NULL on errors. 212/* Return the current working directory. Returns NULL on errors.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 69200b790fb..9c03735c954 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -4651,7 +4651,7 @@ Pascal_functions (FILE *inf)
4651 /* Check if this is an "extern" declaration. */ 4651 /* Check if this is an "extern" declaration. */
4652 if (*dbp == '\0') 4652 if (*dbp == '\0')
4653 continue; 4653 continue;
4654 if (lowcase (*dbp == 'e')) 4654 if (lowcase (*dbp) == 'e')
4655 { 4655 {
4656 if (nocase_tail ("extern")) /* superfluous, really! */ 4656 if (nocase_tail ("extern")) /* superfluous, really! */
4657 { 4657 {
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index bd87b5b6524..2654387fb37 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -1,6 +1,7 @@
1/* Generate doc-string file for GNU Emacs from source files. 1/* Generate doc-string file for GNU Emacs from source files.
2 Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2012 2
3 Free Software Foundation, Inc. 3Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2012
4 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -35,22 +36,26 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
35 36
36#include <config.h> 37#include <config.h>
37 38
38/* Defined to be emacs_main, sys_fopen, etc. in config.h. */
39#undef main
40#undef fopen
41#undef chdir
42
43#include <stdio.h> 39#include <stdio.h>
44#include <stdlib.h> 40#include <stdlib.h> /* config.h unconditionally includes this anyway */
45#ifdef MSDOS 41#ifdef MSDOS
46#include <fcntl.h> 42#include <fcntl.h>
47#endif /* MSDOS */ 43#endif /* MSDOS */
48#ifdef WINDOWSNT 44#ifdef WINDOWSNT
45/* Defined to be sys_fopen in ms-w32.h, but only #ifdef emacs, so this
46 is really just insurance. */
47#undef fopen
49#include <fcntl.h> 48#include <fcntl.h>
50#include <direct.h> 49#include <direct.h>
51#endif /* WINDOWSNT */ 50#endif /* WINDOWSNT */
52 51
53#ifdef DOS_NT 52#ifdef DOS_NT
53/* Defined to be sys_chdir in ms-w32.h, but only #ifdef emacs, so this
54 is really just insurance.
55
56 Similarly, msdos defines this as sys_chdir, but we're not linking with the
57 file where that function is defined. */
58#undef chdir
54#define READ_TEXT "rt" 59#define READ_TEXT "rt"
55#define READ_BINARY "rb" 60#define READ_BINARY "rb"
56#else /* not DOS_NT */ 61#else /* not DOS_NT */
@@ -58,33 +63,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
58#define READ_BINARY "r" 63#define READ_BINARY "r"
59#endif /* not DOS_NT */ 64#endif /* not DOS_NT */
60 65
61#ifndef DIRECTORY_SEP
62#define DIRECTORY_SEP '/'
63#endif
64
65#ifndef IS_DIRECTORY_SEP
66#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
67#endif
68
69/* Use this to suppress gcc's `...may be used before initialized' warnings. */
70#ifdef lint
71# define IF_LINT(Code) Code
72#else
73# define IF_LINT(Code) /* empty */
74#endif
75
76static int scan_file (char *filename); 66static int scan_file (char *filename);
77static int scan_lisp_file (const char *filename, const char *mode); 67static int scan_lisp_file (const char *filename, const char *mode);
78static int scan_c_file (char *filename, const char *mode); 68static int scan_c_file (char *filename, const char *mode);
79static void start_globals (void); 69static void start_globals (void);
80static void write_globals (void); 70static void write_globals (void);
81 71
82#ifdef MSDOS
83/* s/msdos.h defines this as sys_chdir, but we're not linking with the
84 file where that function is defined. */
85#undef chdir
86#endif
87
88#include <unistd.h> 72#include <unistd.h>
89 73
90/* Stdio stream for output to the DOC file. */ 74/* Stdio stream for output to the DOC file. */
@@ -561,14 +545,15 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
561 putc (')', out); 545 putc (')', out);
562} 546}
563 547
564/* The types of globals. */ 548/* The types of globals. These are sorted roughly in decreasing alignment
549 order to avoid allocation gaps, except that functions are last. */
565enum global_type 550enum global_type
566{ 551{
567 FUNCTION, 552 INVALID,
553 LISP_OBJECT,
568 EMACS_INTEGER, 554 EMACS_INTEGER,
569 BOOLEAN, 555 BOOLEAN,
570 LISP_OBJECT, 556 FUNCTION,
571 INVALID
572}; 557};
573 558
574/* A single global. */ 559/* A single global. */
@@ -617,13 +602,8 @@ compare_globals (const void *a, const void *b)
617 const struct global *ga = a; 602 const struct global *ga = a;
618 const struct global *gb = b; 603 const struct global *gb = b;
619 604
620 if (ga->type == FUNCTION) 605 if (ga->type != gb->type)
621 { 606 return ga->type - gb->type;
622 if (gb->type != FUNCTION)
623 return 1;
624 }
625 else if (gb->type == FUNCTION)
626 return -1;
627 607
628 return strcmp (ga->name, gb->name); 608 return strcmp (ga->name, gb->name);
629} 609}
@@ -650,7 +630,7 @@ write_globals (void)
650 type = "EMACS_INT"; 630 type = "EMACS_INT";
651 break; 631 break;
652 case BOOLEAN: 632 case BOOLEAN:
653 type = "int"; 633 type = "bool";
654 break; 634 break;
655 case LISP_OBJECT: 635 case LISP_OBJECT:
656 type = "Lisp_Object"; 636 type = "Lisp_Object";
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index 8c9482b9194..a03d761e7ec 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -23,8 +23,7 @@ ALL = $(BLD)/test-distrib.exe $(BLD)/make-docfile.exe $(BLD)/hexl.exe\
23 23
24.PHONY: make-docfile 24.PHONY: make-docfile
25 25
26LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DNO_LDAV=1 \ 26LOCAL_FLAGS = -DNO_LDAV=1 -DNO_ARCHIVES=1 -I../lib \
27 -DNO_ARCHIVES=1 -I../lib \
28 -I../nt/inc -I../src $(EMACS_EXTRA_C_FLAGS) 27 -I../nt/inc -I../src $(EMACS_EXTRA_C_FLAGS)
29 28
30LIBS = $(BASE_LIBS) $(ADVAPI32) 29LIBS = $(BASE_LIBS) $(ADVAPI32)
@@ -360,7 +359,7 @@ SRC = $(EMACS_ROOT)/src
360NT_INC = $(EMACS_ROOT)/nt/inc 359NT_INC = $(EMACS_ROOT)/nt/inc
361GNU_LIB = $(EMACS_ROOT)/lib 360GNU_LIB = $(EMACS_ROOT)/lib
362 361
363MS_W32_H = $(SRC)/s/ms-w32.h \ 362MS_W32_H = $(NT_INC)/ms-w32.h \
364 $(NT_INC)/sys/stat.h 363 $(NT_INC)/sys/stat.h
365CONF_POST_H = $(SRC)/conf_post.h \ 364CONF_POST_H = $(SRC)/conf_post.h \
366 $(MS_W32_H) 365 $(MS_W32_H)
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index d157aa8c0b9..32d32e69abf 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -22,7 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23/* Important notice: defining MAIL_USE_FLOCK or MAIL_USE_LOCKF *will 23/* Important notice: defining MAIL_USE_FLOCK or MAIL_USE_LOCKF *will
24 cause loss of mail* if you do it on a system that does not normally 24 cause loss of mail* if you do it on a system that does not normally
25 use flock as its way of interlocking access to inbox files. The 25 use flock/lockf as its way of interlocking access to inbox files. The
26 setting of MAIL_USE_FLOCK and MAIL_USE_LOCKF *must agree* with the 26 setting of MAIL_USE_FLOCK and MAIL_USE_LOCKF *must agree* with the
27 system's own conventions. It is not a choice that is up to you. 27 system's own conventions. It is not a choice that is up to you.
28 28
@@ -109,6 +109,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
109#include <sys/locking.h> 109#include <sys/locking.h>
110#endif 110#endif
111 111
112/* If your system uses the `flock' or `lockf' system call for mail locking,
113 define MAIL_USE_SYSTEM_LOCK. If your system type should always define
114 MAIL_USE_LOCKF or MAIL_USE_FLOCK but configure does not do this,
115 please make a bug report. */
116
112#ifdef MAIL_USE_LOCKF 117#ifdef MAIL_USE_LOCKF
113#define MAIL_USE_SYSTEM_LOCK 118#define MAIL_USE_SYSTEM_LOCK
114#endif 119#endif
@@ -275,13 +280,6 @@ main (int argc, char **argv)
275 else 280 else
276#endif 281#endif
277 { 282 {
278 #ifndef DIRECTORY_SEP
279 #define DIRECTORY_SEP '/'
280 #endif
281 #ifndef IS_DIRECTORY_SEP
282 #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
283 #endif
284
285 /* Use a lock file named after our first argument with .lock appended: 283 /* Use a lock file named after our first argument with .lock appended:
286 If it exists, the mail file is locked. */ 284 If it exists, the mail file is locked. */
287 /* Note: this locking mechanism is *required* by the mailer 285 /* Note: this locking mechanism is *required* by the mailer
@@ -290,20 +288,13 @@ main (int argc, char **argv)
290 On systems that use a lock file, extracting the mail without locking 288 On systems that use a lock file, extracting the mail without locking
291 WILL occasionally cause loss of mail due to timing errors! 289 WILL occasionally cause loss of mail due to timing errors!
292 290
293 So, if creation of the lock file fails 291 So, if creation of the lock file fails due to access
294 due to access permission on the mail spool directory, 292 permission on the mail spool directory, you simply MUST
295 you simply MUST change the permission 293 change the permission and/or make movemail a setgid program
296 and/or make movemail a setgid program
297 so it can create lock files properly. 294 so it can create lock files properly.
298 295
299 You might also wish to verify that your system is one 296 You might also wish to verify that your system is one which
300 which uses lock files for this purpose. Some systems use other methods. 297 uses lock files for this purpose. Some systems use other methods. */
301
302 If your system uses the `flock' system call for mail locking,
303 define MAIL_USE_SYSTEM_LOCK in config.h or the s-*.h file
304 and recompile movemail. If the s- file for your system
305 should define MAIL_USE_SYSTEM_LOCK but does not, send a bug report
306 to bug-gnu-emacs@prep.ai.mit.edu so we can fix it. */
307 298
308 inname_len = strlen (inname); 299 inname_len = strlen (inname);
309 lockname = xmalloc (inname_len + sizeof ".lock"); 300 lockname = xmalloc (inname_len + sizeof ".lock");
@@ -560,8 +551,8 @@ main (int argc, char **argv)
560 wait (&wait_status); 551 wait (&wait_status);
561 if (!WIFEXITED (wait_status)) 552 if (!WIFEXITED (wait_status))
562 exit (EXIT_FAILURE); 553 exit (EXIT_FAILURE);
563 else if (WRETCODE (wait_status) != 0) 554 else if (WEXITSTATUS (wait_status) != 0)
564 exit (WRETCODE (wait_status)); 555 exit (WEXITSTATUS (wait_status));
565 556
566#if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_SYSTEM_LOCK) 557#if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_SYSTEM_LOCK)
567#ifdef MAIL_USE_MAILLOCK 558#ifdef MAIL_USE_MAILLOCK
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index d3b001c157c..2cc791fb56a 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -1,5 +1,9 @@
1/* Utility and Unix shadow routines for GNU Emacs support programs on NT. 1/* Utility and Unix shadow routines for GNU Emacs support programs on NT.
2 Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc. 2
3Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc.
4
5Author: Geoff Voelker (voelker@cs.washington.edu)
6Created: 10-8-94
3 7
4This file is part of GNU Emacs. 8This file is part of GNU Emacs.
5 9
@@ -14,11 +18,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details. 18GNU General Public License for more details.
15 19
16You should have received a copy of the GNU General Public License 20You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 21along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18
19
20 Geoff Voelker (voelker@cs.washington.edu) 10-8-94
21*/
22 22
23#include <windows.h> 23#include <windows.h>
24#include <stdlib.h> 24#include <stdlib.h>
@@ -260,6 +260,7 @@ is_exec (const char * name)
260 stricmp (p, ".cmd") == 0)); 260 stricmp (p, ".cmd") == 0));
261} 261}
262 262
263/* FIXME? This is in config.nt now - is this still needed? */
263#define IS_DIRECTORY_SEP(x) ((x) == '/' || (x) == '\\') 264#define IS_DIRECTORY_SEP(x) ((x) == '/' || (x) == '\\')
264 265
265/* We need this because nt/inc/sys/stat.h defines struct stat that is 266/* We need this because nt/inc/sys/stat.h defines struct stat that is
@@ -374,3 +375,9 @@ stat (const char * path, struct stat * buf)
374 return 0; 375 return 0;
375} 376}
376 377
378int
379lstat (const char * path, struct stat * buf)
380{
381 return stat (path, buf);
382}
383
diff --git a/lib-src/profile.c b/lib-src/profile.c
index d21f2c28e58..3489e492543 100644
--- a/lib-src/profile.c
+++ b/lib-src/profile.c
@@ -30,6 +30,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 */ 30 */
31#include <config.h> 31#include <config.h>
32 32
33#define SYSTIME_INLINE EXTERN_INLINE
34
33#include <inttypes.h> 35#include <inttypes.h>
34#include <stdio.h> 36#include <stdio.h>
35 37