aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-05-16 15:48:54 +0300
committerEli Zaretskii2013-05-16 15:48:54 +0300
commitdf065a0b9a1ad4be56ffd30bba934b940e85c2c3 (patch)
tree55c7ca0dd3993d45d3bb54877fb31f025b0ca0ea /src
parentdcfda130117b8a79f4253197b48cf09ba35a3b72 (diff)
parentf1e496a5c86d88c2d6f92c5083b1a9ee11f90109 (diff)
downloademacs-df065a0b9a1ad4be56ffd30bba934b940e85c2c3.tar.gz
emacs-df065a0b9a1ad4be56ffd30bba934b940e85c2c3.zip
Support building Emacs on MS-Windows using the Posix configury.
lib/Makefile.am: If building for MS-Windows, include nt/gnulib.mk instead of lib/gnulib.mk. configure.ac: Adapt to MSYS build on MS-Windows. Makefile.in (NTDIR): New variable, for the MSYS build on MS-Windows. (SUBDIR): Add $(NTDIR). (.PHONY): Add epaths-force-w32. (msys_to_w32): New variable. (epaths-force-w32, install-nt, uninstall-nt): New targets. (lib-src src): Add $(NTLIB) to prerequisites. (lib lib-src lisp leim nt): Add 'nt'. (config.status): Use $(CFG). (.PHONY): Add install-$(NTDIR) and uninstall-$(NTDIR). (install, install-arch-dep): Add install-$(NTDIR). (uninstall): Depend on uninstall-$(NTDIR). (mostlyclean, clean, distclean, bootstrap-clean): Add 'nt'. * GNUmakefile (CFG): New variable, uses mingw-cfg.site as CONFIG_SITE for the MSYS build on MS-Windows. (Makefile): Use $(CFG). .bzrignore: Ignore *.res, *.tmp, and *.map. Remove src/emacs.res. etc/NEWS: Advertise the MSYS build on MS-Windows. leim/Makefile.in (leim-list.el, check-declare): Use reveal-filename. lib-src/update-game-score.c [WINDOWSNT]: Include "ntlib.h". lib-src/ntlib.h (sleep): Update prototype. (geteuid): Add prototype. lib-src/ntlib.c (sleep): Now returns an unsigned value. (getgid): New function. lib-src/Makefile.in (CLIENTW, LIB_WSOCK32, LIBS_ECLIENT, NTLIB) (CLIENTRES, WINDRES, NTINC, NTDEPS): New variables. (INSTALLABLES): Add $(CLIENTW). (LIBS_MOVE): Use $(LIB_WSOCK32). ($(DESTDIR)${archlibdir}): Use $(EXEEXT) on update-game-score. (test-distrib${EXEEXT}): Use $(EXEEXT) on test-distrib. (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT}) (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT}) (emacsclient${EXEEXT}, hexl${EXEEXT}, update-game-score${EXEEXT}): Add $(NTLIB) to prerequisites. Use $(EXEEXT). (pop.o): Add pop.h to prerequisites. (emacsclientw${EXEEXT}, ntlib.o): New targets. (emacsclient.res): New target. lisp/subr.el (reveal-filename): New function. lisp/loadup.el: Compute Emacs executable versions on MS-Windows, where executables have the .exe extension. Add a hard link emacs-XX.YY.ZZ.exe on MS-Windows. lisp/Makefile.in (XARGS_LIMIT): New variable. (custom-deps, finder-data, autoloads) ($(MH_E_DIR)/mh-loaddefs.el, $(TRAMP_DIR)/tramp-loaddefs.el) ($(CAL_DIR)/cal-loaddefs.el, $(CAL_DIR)/diary-loaddefs.el) ($(CAL_DIR)/hol-loaddefs.el): Use reveal-filename. (compile-main): Limit xargs according to $(XARGS_LIMIT). nt/msysconfig.sh: New file. nt/mingw-cfg.site: New file. nt/makefile.w32-in (LOCAL_FLAGS): Add -DOLD_PATHS=1. nt/inc/unistd.h: Include pwd.h and sys/types.h. nt/inc/sys/time.h (_TIMEVAL_DEFINED, timerisset, timercmp) (timerclear): Define. (gettimeofday): Adjust signature to be Posix compatible, by using the 'restrict' keyword. nt/inc/sys/stat.h (UTIME_NOW, UTIME_OMIT): Define. (struct _stat, struct _stati64): Define. nt/inc/sys/socket.h (timeval): Define only for MSVC. (FD_SET, FD_CLR, FD_ISSET, fd_set): Redefine only if EMACS_CONFIG_H is defined. (timeval): Undefine only for MSVC. nt/inc/ms-w32.h (HAVE___BUILTIN_UNWIND_INIT, restrict) (HAVE_WINDOW_SYSTEM, HAVE_MENUS, EMACS_CONFIGURATION) (EMACS_CONFIG_OPTIONS, HAVE_LONG_LONG_INT) (HAVE_UNSIGNED_LONG_LONG_INT): Define only if not already defined. (fileno): Move definition after including stdio.h. (sigset_t): Guard typedef by _W64. nt/gnulib.mk: New file. nt/epaths.nt: New file. nt/addpm.c [!OLD_PATHS]: Include src/epaths.h, instead of having a copy of the file names there. <env_vars> [!OLD_PATHS]: Use macros from epaths.h instead of literal strings. nt/Makefile.in: New file. nt/INSTALL.MSYS: New file. nt/INSTALL: Mention INSTALL.MSYS. src/w32.c: Include epaths.h. (init_environment): Use cmdproxy.exe without leading directories. Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that case. (gettimeofday): Adjust signature and return value to Posix expectations. src/unexw32.c (open_output_file): Delete the existing emacs.exe before creating it, to break the hard link to the versioned executable. src/Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK) (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK) (FIRSTFILE_OBJ): New variables. (W32_RES): Rename to EMACSRES. All users changed. (base_obj): Use $(CM_OBJ). (ALLOBJS): Use $(FIRSTFILE_OBJ). (emacs$(EXEEXT)): Depend on $(ADDSECTION). (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move $(W32_RES_LINK) before $(LIBES). (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog24
-rw-r--r--src/Makefile.in42
-rw-r--r--src/unexw32.c8
-rw-r--r--src/w32.c72
4 files changed, 127 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c45ec824919..e5308e2db3b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,27 @@
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c: Include epaths.h.
4 (init_environment): Use cmdproxy.exe without leading directories.
5 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
6 case.
7 (gettimeofday): Adjust signature and return value to Posix
8 expectations.
9
10 * unexw32.c (open_output_file): Delete the existing emacs.exe
11 before creating it, to break the hard link to the versioned
12 executable.
13
14 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
15 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
16 (FIRSTFILE_OBJ): New variables.
17 (W32_RES): Rename to EMACSRES. All users changed.
18 (base_obj): Use $(CM_OBJ).
19 (ALLOBJS): Use $(FIRSTFILE_OBJ).
20 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
21 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
22 $(W32_RES_LINK) before $(LIBES).
23 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
24
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 252013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 26
3 * makefile.w32-in (DOC): Use just "DOC". 27 * makefile.w32-in (DOC): Use just "DOC".
diff --git a/src/Makefile.in b/src/Makefile.in
index 80d23b2d58b..c7a18363a5a 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -267,10 +267,13 @@ W32_OBJ=@W32_OBJ@
267W32_LIBS=@W32_LIBS@ 267W32_LIBS=@W32_LIBS@
268 268
269## emacs.res if HAVE_W32 269## emacs.res if HAVE_W32
270W32_RES=@W32_RES@ 270EMACSRES = @EMACSRES@
271## emacs-*.manifest if HAVE_W32
272EMACS_MANIFEST = @EMACS_MANIFEST@
271## If HAVE_W32, compiler arguments for including 273## If HAVE_W32, compiler arguments for including
272## the resource file in the binary. 274## the resource file in the binary.
273## XXX -Wl,-b -Wl,pe-i386 -Wl,emacs.res 275## Cygwin: -Wl,emacs.res
276## MinGW: emacs.res
274W32_RES_LINK=@W32_RES_LINK@ 277W32_RES_LINK=@W32_RES_LINK@
275 278
276## Empty if !HAVE_X_WINDOWS 279## Empty if !HAVE_X_WINDOWS
@@ -279,6 +282,9 @@ W32_RES_LINK=@W32_RES_LINK@
279## else xfont.o 282## else xfont.o
280FONT_OBJ=@FONT_OBJ@ 283FONT_OBJ=@FONT_OBJ@
281 284
285## Empty for MinGW, cm.o for the rest.
286CM_OBJ=@CM_OBJ@
287
282LIBGPM = @LIBGPM@ 288LIBGPM = @LIBGPM@
283 289
284## -lresolv, or empty. 290## -lresolv, or empty.
@@ -297,6 +303,14 @@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
297 303
298RUN_TEMACS = `/bin/pwd`/temacs 304RUN_TEMACS = `/bin/pwd`/temacs
299 305
306## Invoke ../nt/addsection for MinGW, ":" elsewhere.
307TEMACS_POST_LINK = @TEMACS_POST_LINK@
308ADDSECTION = @ADDSECTION@
309EMACS_HEAPSIZE = @EMACS_HEAPSIZE@
310MINGW_TEMACS_POST_LINK = \
311 mv temacs$(EXEEXT) temacs.tmp; \
312 ../nt/addsection temacs.tmp temacs$(EXEEXT) EMHEAP $(EMACS_HEAPSIZE)
313
300UNEXEC_OBJ = @UNEXEC_OBJ@ 314UNEXEC_OBJ = @UNEXEC_OBJ@
301 315
302CANNOT_DUMP=@CANNOT_DUMP@ 316CANNOT_DUMP=@CANNOT_DUMP@
@@ -339,7 +353,7 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
339## be dumped as pure by dump-emacs. 353## be dumped as pure by dump-emacs.
340base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ 354base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
341 charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \ 355 charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
342 cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \ 356 $(CM_OBJ) term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
343 emacs.o keyboard.o macros.o keymap.o sysdep.o \ 357 emacs.o keyboard.o macros.o keymap.o sysdep.o \
344 buffer.o filelock.o insdel.o marker.o \ 358 buffer.o filelock.o insdel.o marker.o \
345 minibuf.o fileio.o dired.o \ 359 minibuf.o fileio.o dired.o \
@@ -377,9 +391,9 @@ VMLIMIT_OBJ=@VMLIMIT_OBJ@
377## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty. 391## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty.
378RALLOC_OBJ=@RALLOC_OBJ@ 392RALLOC_OBJ=@RALLOC_OBJ@
379 393
380## Empty on Cygwin, lastfile.o elsewhere. 394## Empty on Cygwin and MinGW, lastfile.o elsewhere.
381PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@ 395PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@
382## lastfile.o on Cygwin, empty elsewhere. 396## lastfile.o on Cygwin and MinGW, empty elsewhere.
383POST_ALLOC_OBJ=@POST_ALLOC_OBJ@ 397POST_ALLOC_OBJ=@POST_ALLOC_OBJ@
384 398
385## List of object files that make-docfile should not be told about. 399## List of object files that make-docfile should not be told about.
@@ -387,7 +401,9 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
387 $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS) 401 $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
388 402
389## All object files linked into temacs. $(VMLIMIT_OBJ) should be first. 403## All object files linked into temacs. $(VMLIMIT_OBJ) should be first.
390ALLOBJS = $(VMLIMIT_OBJ) $(obj) $(otherobj) 404## (On MinGW, firstfile.o should be before vm-limit.o.)
405FIRSTFILE_OBJ=@FIRSTFILE_OBJ@
406ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj)
391 407
392## Configure inserts the file lisp.mk at this point, defining $lisp. 408## Configure inserts the file lisp.mk at this point, defining $lisp.
393@lisp_frag@ 409@lisp_frag@
@@ -416,7 +432,8 @@ $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
416## Strictly speaking, emacs does not depend directly on all of $lisp, 432## Strictly speaking, emacs does not depend directly on all of $lisp,
417## since not all pieces are used on all platforms. But DOC depends 433## since not all pieces are used on all platforms. But DOC depends
418## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here. 434## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
419emacs$(EXEEXT): temacs$(EXEEXT) $(etc)/DOC $(lisp) $(leimdir)/leim-list.el 435emacs$(EXEEXT): temacs$(EXEEXT) $(ADDSECTION) \
436 $(etc)/DOC $(lisp) $(leimdir)/leim-list.el
420 if test "$(CANNOT_DUMP)" = "yes"; then \ 437 if test "$(CANNOT_DUMP)" = "yes"; then \
421 rm -f emacs$(EXEEXT); \ 438 rm -f emacs$(EXEEXT); \
422 ln temacs$(EXEEXT) emacs$(EXEEXT); \ 439 ln temacs$(EXEEXT) emacs$(EXEEXT); \
@@ -468,10 +485,10 @@ $(lib)/libgnu.a: $(config_h)
468 cd $(lib) && $(MAKE) libgnu.a 485 cd $(lib) && $(MAKE) libgnu.a
469 486
470temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \ 487temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \
471 $(lib)/libgnu.a $(W32_RES) 488 $(lib)/libgnu.a $(EMACSRES)
472 $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ 489 $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
473 -o temacs $(ALLOBJS) $(lib)/libgnu.a $(LIBES) \ 490 -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
474 $(W32_RES_LINK) 491 $(TEMACS_POST_LINK)
475 test "$(CANNOT_DUMP)" = "yes" || \ 492 test "$(CANNOT_DUMP)" = "yes" || \
476 test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT) 493 test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
477 494
@@ -514,8 +531,9 @@ doc.o: buildobj.h
514 531
515emacs.res: $(ntsource)/emacs.rc \ 532emacs.res: $(ntsource)/emacs.rc \
516 $(ntsource)/icons/emacs.ico \ 533 $(ntsource)/icons/emacs.ico \
517 $(ntsource)/emacs-x86.manifest 534 $(ntsource)/$(EMACS_MANIFEST)
518 $(WINDRES) -O COFF -o $@ $(ntsource)/emacs.rc 535 $(WINDRES) -O COFF --include-dir=$(srcdir)/../nt \
536 -o $@ $(ntsource)/emacs.rc
519 537
520ns-app: emacs$(EXEEXT) 538ns-app: emacs$(EXEEXT)
521 cd ../nextstep && $(MAKE) $(MFLAGS) all 539 cd ../nextstep && $(MAKE) $(MFLAGS) all
diff --git a/src/unexw32.c b/src/unexw32.c
index e8b553a87d3..a01ac799592 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -159,6 +159,14 @@ open_output_file (file_data *p_file, char *filename, unsigned long size)
159 HANDLE file_mapping; 159 HANDLE file_mapping;
160 void *file_base; 160 void *file_base;
161 161
162 /* We delete any existing FILENAME because loadup.el will create a
163 hard link to it under the name emacs-XX.YY.ZZ.nn.exe. Evidently,
164 overwriting a file on Unix breaks any hard links to it, but that
165 doesn't happen on Windows. If we don't delete the file before
166 creating it, all the emacs-XX.YY.ZZ.nn.exe end up being hard
167 links to the same file, which defeats the purpose of these hard
168 links: being able to run previous builds. */
169 DeleteFile (filename);
162 file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, 170 file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
163 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); 171 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
164 if (file == INVALID_HANDLE_VALUE) 172 if (file == INVALID_HANDLE_VALUE)
diff --git a/src/w32.c b/src/w32.c
index 431826c4b82..7d63c73eb18 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -65,6 +65,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
65#undef localtime 65#undef localtime
66 66
67#include "lisp.h" 67#include "lisp.h"
68#include "epaths.h" /* for SHELL */
68 69
69#include <pwd.h> 70#include <pwd.h>
70#include <grp.h> 71#include <grp.h>
@@ -2018,7 +2019,7 @@ init_environment (char ** argv)
2018 {"PRELOAD_WINSOCK", NULL}, 2019 {"PRELOAD_WINSOCK", NULL},
2019 {"emacs_dir", "C:/emacs"}, 2020 {"emacs_dir", "C:/emacs"},
2020 {"EMACSLOADPATH", NULL}, 2021 {"EMACSLOADPATH", NULL},
2021 {"SHELL", "%emacs_dir%/bin/cmdproxy.exe"}, 2022 {"SHELL", "cmdproxy.exe"}, /* perhaps it is somewhere on PATH */
2022 {"EMACSDATA", NULL}, 2023 {"EMACSDATA", NULL},
2023 {"EMACSPATH", NULL}, 2024 {"EMACSPATH", NULL},
2024 {"INFOPATH", NULL}, 2025 {"INFOPATH", NULL},
@@ -2094,9 +2095,12 @@ init_environment (char ** argv)
2094 emacs_abort (); 2095 emacs_abort ();
2095 *p = 0; 2096 *p = 0;
2096 2097
2097 if ((p = _mbsrchr (modname, '\\')) && xstrcasecmp (p, "\\bin") == 0) 2098 if ((p = _mbsrchr (modname, '\\'))
2099 /* From bin means installed Emacs, from src means uninstalled. */
2100 && (xstrcasecmp (p, "\\bin") == 0 || xstrcasecmp (p, "\\src") == 0))
2098 { 2101 {
2099 char buf[SET_ENV_BUF_SIZE]; 2102 char buf[SET_ENV_BUF_SIZE];
2103 int within_build_tree = xstrcasecmp (p, "\\src") == 0;
2100 2104
2101 *p = 0; 2105 *p = 0;
2102 for (p = modname; *p; p = CharNext (p)) 2106 for (p = modname; *p; p = CharNext (p))
@@ -2104,6 +2108,15 @@ init_environment (char ** argv)
2104 2108
2105 _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname); 2109 _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
2106 _putenv (strdup (buf)); 2110 _putenv (strdup (buf));
2111 /* If we are running from the Posix-like build tree, define
2112 SHELL to point to our own cmdproxy. The loop below will
2113 then disregard PATH_EXEC and the default value. */
2114 if (within_build_tree)
2115 {
2116 _snprintf (buf, sizeof (buf) - 1,
2117 "SHELL=%s/nt/cmdproxy.exe", modname);
2118 _putenv (strdup (buf));
2119 }
2107 } 2120 }
2108 /* Handle running emacs from the build directory: src/oo-spd/i386/ */ 2121 /* Handle running emacs from the build directory: src/oo-spd/i386/ */
2109 2122
@@ -2139,16 +2152,60 @@ init_environment (char ** argv)
2139 if (!getenv (env_vars[i].name)) 2152 if (!getenv (env_vars[i].name))
2140 { 2153 {
2141 int dont_free = 0; 2154 int dont_free = 0;
2155 char bufc[SET_ENV_BUF_SIZE];
2142 2156
2143 if ((lpval = w32_get_resource (env_vars[i].name, &dwType)) == NULL 2157 if ((lpval = w32_get_resource (env_vars[i].name, &dwType)) == NULL
2144 /* Also ignore empty environment variables. */ 2158 /* Also ignore empty environment variables. */
2145 || *lpval == 0) 2159 || *lpval == 0)
2146 { 2160 {
2147 xfree (lpval); 2161 xfree (lpval);
2148 lpval = env_vars[i].def_value;
2149 dwType = REG_EXPAND_SZ;
2150 dont_free = 1; 2162 dont_free = 1;
2151 if (!strcmp (env_vars[i].name, "HOME") && !appdata) 2163 if (strcmp (env_vars[i].name, "SHELL") == 0)
2164 {
2165 /* Look for cmdproxy.exe in every directory in
2166 PATH_EXEC. FIXME: This does not find cmdproxy
2167 in nt/ when we run uninstalled. */
2168 char fname[MAX_PATH];
2169 const char *pstart = PATH_EXEC, *pend;
2170
2171 do {
2172 pend = _mbschr (pstart, ';');
2173 if (!pend)
2174 pend = pstart + strlen (pstart);
2175 /* Be defensive against series of ;;; characters. */
2176 if (pend > pstart)
2177 {
2178 strncpy (fname, pstart, pend - pstart);
2179 fname[pend - pstart] = '/';
2180 strcpy (&fname[pend - pstart + 1], "cmdproxy.exe");
2181 ExpandEnvironmentStrings ((LPSTR) fname, bufc,
2182 sizeof (bufc));
2183 if (check_existing (bufc))
2184 {
2185 lpval = bufc;
2186 dwType = REG_SZ;
2187 break;
2188 }
2189 }
2190 if (*pend)
2191 pstart = pend + 1;
2192 else
2193 pstart = pend;
2194 if (!*pstart)
2195 {
2196 /* If not found in any directory, use the
2197 default as the last resort. */
2198 lpval = env_vars[i].def_value;
2199 dwType = REG_EXPAND_SZ;
2200 }
2201 } while (*pstart);
2202 }
2203 else
2204 {
2205 lpval = env_vars[i].def_value;
2206 dwType = REG_EXPAND_SZ;
2207 }
2208 if (strcmp (env_vars[i].name, "HOME") == 0 && !appdata)
2152 Vdelayed_warnings_list 2209 Vdelayed_warnings_list
2153 = Fcons (listn (CONSTYPE_HEAP, 2, 2210 = Fcons (listn (CONSTYPE_HEAP, 2,
2154 intern ("initialization"), 2211 intern ("initialization"),
@@ -2394,8 +2451,8 @@ get_emacs_configuration_options (void)
2394#include <sys/timeb.h> 2451#include <sys/timeb.h>
2395 2452
2396/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ 2453/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */
2397void 2454int
2398gettimeofday (struct timeval *tv, struct timezone *tz) 2455gettimeofday (struct timeval *restrict tv, struct timezone *restrict tz)
2399{ 2456{
2400 struct _timeb tb; 2457 struct _timeb tb;
2401 _ftime (&tb); 2458 _ftime (&tb);
@@ -2413,6 +2470,7 @@ gettimeofday (struct timeval *tv, struct timezone *tz)
2413 tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ 2470 tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */
2414 tz->tz_dsttime = tb.dstflag; /* type of dst correction */ 2471 tz->tz_dsttime = tb.dstflag; /* type of dst correction */
2415 } 2472 }
2473 return 0;
2416} 2474}
2417 2475
2418/* Emulate fdutimens. */ 2476/* Emulate fdutimens. */