summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2012-12-10 09:55:03 -0800
committerDaniel Colascione <dancol@dancol.org>2012-12-10 09:55:03 -0800
commit78f9ea875a65686b5e300d73dbf22dd96ca29851 (patch)
treed30e965b537930a2c7ba999210ae56651562ac26 /src
parent322a542e6c13eb89b8abc302278e77684c1d6479 (diff)
downloademacs-78f9ea875a65686b5e300d73dbf22dd96ca29851.tar.gz
Move fix for bug#12993 to trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog21
-rw-r--r--src/Makefile.in21
-rw-r--r--src/emacs.c8
-rw-r--r--src/unexw32.c16
-rw-r--r--src/w32fns.c4
-rw-r--r--src/w32gui.h3
6 files changed, 24 insertions, 49 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index be2d3dd6a6f..9d9c1fdaff5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,24 +1,3 @@
-2012-12-10 Daniel Colascione <dancol@dancol.org>
-
- * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
- declarations.
-
- * w32fns.c (cache_system_info): Initialize the global hinst
- variable here so various initialization calls DTRT.
-
- * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused
- variables.
- (hinst): Remove unneeded extern declaration.
- (_start): Remove initialization of above variables; remove
- initialization of hinst, as cache_system_info now does that.
-
- * emacs.c (main): Call cache_system_info early in startup; we
- previously weren't calling it in Cygwin builds.
-
- * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK): Teach
- the autoconf build system how to compile a Windows resource file
- and link it to Emacs.
-
2012-12-08 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
diff --git a/src/Makefile.in b/src/Makefile.in
index 75624dc0631..c24e421bbbc 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -28,11 +28,9 @@ SHELL = /bin/sh
# Here are the things that we expect ../configure to edit.
# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
srcdir = @srcdir@
-ntsource = $(srcdir)/../nt
abs_builddir = @abs_builddir@
VPATH = $(srcdir)
CC = @CC@
-WINDRES = @WINDRES@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
@@ -268,13 +266,6 @@ W32_OBJ=@W32_OBJ@
## --lwinspool if HAVE_W32, else empty.
W32_LIBS=@W32_LIBS@
-## emacs.res if HAVE_W32
-W32_RES=@W32_RES@
-## If HAVE_W32, compiler arguments for including
-## the resource file in the binary.
-## XXX -Wl,-b -Wl,pe-i386 -Wl,emacs.res
-W32_RES_LINK=@W32_RES_LINK@
-
## Empty if !HAVE_X_WINDOWS
## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT
## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE
@@ -337,6 +328,7 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
@$(MKDEPDIR)
$(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
+
## lastfile must follow all files whose initialized data areas should
## be dumped as pure by dump-emacs.
base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
@@ -470,11 +462,9 @@ $(obj) $(otherobj): globals.h
$(lib)/libgnu.a: $(config_h)
cd $(lib) && $(MAKE) libgnu.a
-temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) \
- $(lib)/libgnu.a $(W32_RES)
+temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) $(lib)/libgnu.a
$(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(TEMACS_LDFLAGS2) \
- -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) \
- $(W32_RES_LINK)
+ -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES)
test "$(CANNOT_DUMP)" = "yes" || \
test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
@@ -515,14 +505,11 @@ $(OLDXMENU): $(OLDXMENU_TARGET)
doc.o: buildobj.h
-emacs.res: $(ntsource)/emacs.rc \
- $(ntsource)/icons/emacs.ico \
- $(ntsource)/emacs-x86.manifest
- $(WINDRES) -O COFF -o $@ $(ntsource)/emacs.rc
ns-app: emacs$(EXEEXT)
cd ../nextstep && $(MAKE) $(MFLAGS) all
+
.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
.PHONY: versionclean extraclean frc
diff --git a/src/emacs.c b/src/emacs.c
index 4f5044db1c5..f533c3ae983 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -40,7 +40,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#if defined WINDOWSNT || defined HAVE_NTGUI
#include "w32select.h"
#include "w32font.h"
-#include "w32common.h"
#endif
#if defined HAVE_NTGUI && defined CYGWIN
@@ -721,13 +720,6 @@ main (int argc, char **argv)
}
#endif
-#if defined WINDOWSNT || defined HAVE_NTGUI
- /* Set global variables used to detect Windows version. Do this as
- early as possible. (unexw32.c calls this function as well, but
- the additional call here is harmless.) */
- cache_system_info ();
-#endif
-
#ifdef RUN_TIME_REMAP
if (initialized)
run_time_remap (argv[0]);
diff --git a/src/unexw32.c b/src/unexw32.c
index ee1deb5f92e..1e591a78b73 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -85,6 +85,13 @@ DWORD_PTR extra_bss_size_static = 0;
PIMAGE_SECTION_HEADER heap_section;
+#ifdef HAVE_NTGUI
+extern HINSTANCE hinst;
+HINSTANCE hprevinst = NULL;
+LPSTR lpCmdLine = "";
+int nCmdShow = 0;
+#endif /* HAVE_NTGUI */
+
/* Startup code for running on NT. When we are running as the dumped
version, we need to bootstrap our heap and .bss section into our
address space before we can actually hand off control to the startup
@@ -114,6 +121,15 @@ _start (void)
/* Prevent Emacs from being locked up (eg. in batch mode) when
accessing devices that aren't mounted (eg. removable media drives). */
SetErrorMode (SEM_FAILCRITICALERRORS);
+
+ /* Invoke the NT CRT startup routine now that our housecleaning
+ is finished. */
+#ifdef HAVE_NTGUI
+ /* determine WinMain args like crt0.c does */
+ hinst = GetModuleHandle (NULL);
+ lpCmdLine = GetCommandLine ();
+ nCmdShow = SW_SHOWDEFAULT;
+#endif
mainCRTStartup ();
}
diff --git a/src/w32fns.c b/src/w32fns.c
index 90bbc61eec6..de5cee1d7a7 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1828,6 +1828,7 @@ static LRESULT CALLBACK w32_wnd_proc (HWND, UINT, WPARAM, LPARAM);
static BOOL
w32_init_class (HINSTANCE hinst)
{
+
if (w32_unicode_gui)
{
WNDCLASSW uwc;
@@ -7019,9 +7020,6 @@ cache_system_info (void)
DWORD data;
} version;
- /* Cache the module handle of Emacs itself. */
- hinst = GetModuleHandle (NULL);
-
/* Cache the version of the operating system. */
version.data = GetVersion ();
w32_major_version = version.info.major;
diff --git a/src/w32gui.h b/src/w32gui.h
index fe2bb2334b5..0da8de97f23 100644
--- a/src/w32gui.h
+++ b/src/w32gui.h
@@ -79,6 +79,9 @@ typedef struct _XImage
#define FACE_DEFAULT (~0)
extern HINSTANCE hinst;
+extern HINSTANCE hprevinst;
+extern LPSTR lpCmdLine;
+extern int nCmdShow;
/* Bit Gravity */