Skip to content

Instantly share code, notes, and snippets.

@koichiro
Created May 21, 2009 08:29
Show Gist options
  • Save koichiro/115356 to your computer and use it in GitHub Desktop.
Save koichiro/115356 to your computer and use it in GitHub Desktop.
Index: src/sysdep.c
===================================================================
--- src/sysdep.c (revision 4248)
+++ src/sysdep.c (working copy)
@@ -201,6 +201,10 @@
#include <utime.h>
#endif
+
+#if _MSC_VER >= 1400
+#include <sys/utime.h>
+#else
#ifndef HAVE_UTIMES
#ifndef HAVE_STRUCT_UTIMBUF
/* We want to use utime rather than utimes, but we couldn't find the
@@ -211,6 +215,7 @@
};
#endif
#endif
+#endif
/* LPASS8 is new in 4.3, and makes cbreak mode provide all 8 bits. */
#ifndef LPASS8
Index: src/mw32term.c
===================================================================
--- src/mw32term.c (revision 4248)
+++ src/mw32term.c (working copy)
@@ -43,7 +43,9 @@
#include "blockinput.h"
#include "mw32sync.h"
#include <shellapi.h>
+#if _MSC_VER < 1500
#include <winable.h>
+#endif
#include "mw32term.h"
#include "mw32mci.h"
@@ -225,7 +227,7 @@
static MSG last_mouse_motion_message;
/* Layered Window */
-SETLAYEREDWINDOWATTRPROC SetLayeredWindowAttributes = NULL;
+SETLAYEREDWINDOWATTRPROC SetLayeredWindowAttributesProc = NULL;
typedef UINT (WINAPI *SENDINPUTPROC)(UINT, INPUT*, int);
SENDINPUTPROC SendInputProc = NULL;
@@ -854,7 +856,7 @@
{
int newalpha, oldalpha;
- if (! SetLayeredWindowAttributes) return;
+ if (! SetLayeredWindowAttributesProc) return;
if (MW32_MAIN_THREAD_P ())
{
@@ -886,11 +888,11 @@
| WS_EX_LAYERED);
if (oldalpha != newalpha)
- SetLayeredWindowAttributes (FRAME_MW32_WINDOW (f),
- RGB (255, 255, 255),
- (BYTE) ((float) newalpha
- / (float) 100 * (float) 255),
- LWA_ALPHA);
+ SetLayeredWindowAttributesProc (FRAME_MW32_WINDOW (f),
+ RGB (255, 255, 255),
+ (BYTE) ((float) newalpha
+ / (float) 100 * (float) 255),
+ LWA_ALPHA);
}
f->output_data.mw32->current_alpha = newalpha;
@@ -6600,7 +6602,7 @@
= (TrackMouseEvent_Proc) GetProcAddress (user32_lib, "TrackMouseEvent");
/* Layered Window */
- SetLayeredWindowAttributes = (SETLAYEREDWINDOWATTRPROC)
+ SetLayeredWindowAttributesProc = (SETLAYEREDWINDOWATTRPROC)
GetProcAddress (user32_lib, "SetLayeredWindowAttributes");
SendInputProc = (SENDINPUTPROC)
Index: src/makefile.mw32-in
===================================================================
--- src/makefile.mw32-in (revision 4248)
+++ src/makefile.mw32-in (working copy)
@@ -31,7 +31,7 @@
# HAVE_CONFIG_H is required by some generic gnu sources stuck into
# the emacs source tree.
#
-LOCAL_FLAGS = -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I../nt/inc -D_UCHAR_T -DHAVE_NTGUI=1 $(EMACS_EXTRA_C_FLAGS)
+LOCAL_FLAGS = -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I../nt/inc -D_UCHAR_T -DHAVE_NTGUI=1 $(EMACS_EXTRA_C_FLAGS) -DUSE_CRT_DLL
EMACS = $(BLD)/Meadow.exe
TEMACS = $(BLD)/temacs.exe
Index: src/w32.c
===================================================================
--- src/w32.c (revision 4248)
+++ src/w32.c (working copy)
@@ -1116,6 +1116,9 @@
read-only filesystem, like CD-ROM or a write-protected floppy.
The only way to be really sure is to actually create a file and
see if it succeeds. But I think that's too much to ask. */
+#if _MSC_VER >= 1400
+#define _access sys_access
+#endif
if (tmp && _access (tmp, D_OK) == 0)
{
char * var = alloca (strlen (tmp) + 8);
@@ -1123,6 +1126,9 @@
_putenv (strdup (var));
break;
}
+#if _MSC_VER >= 1400
+#undef _access
+#endif
}
if (i >= imax)
cmd_error_internal
@@ -3056,6 +3062,7 @@
}
#endif
+#if _MSC_VER < 1400
int
utime (const char *name, struct utimbuf *times)
{
@@ -3092,6 +3099,7 @@
}
return 0;
}
+#endif
#ifdef HAVE_SOCKETS
Index: src/s/ms-w32.h
===================================================================
--- src/s/ms-w32.h (revision 4248)
+++ src/s/ms-w32.h (working copy)
@@ -392,7 +392,9 @@
#define pclose _pclose
#define putw _putw
#define umask _umask
+#if _MSC_VER < 1400
#define utimbuf _utimbuf
+#endif
#define index strchr
#define rindex strrchr
#define strdup _strdup
Index: src/strftime.c
===================================================================
--- src/strftime.c (revision 4248)
+++ src/strftime.c (working copy)
@@ -58,6 +58,9 @@
extern char *tzname[];
#endif
#endif
+#if _MSC_VER >= 1400
+#define tzname _tzname
+#endif
/* Do multibyte processing if multibytes are supported, unless
multibyte sequences are safe in formats. Multibyte sequences are
Index: src/mw32fns.c
===================================================================
--- src/mw32fns.c (revision 4248)
+++ src/mw32fns.c (working copy)
@@ -1010,7 +1010,7 @@
/* defined in mw32term.c */
extern void mw32_update_frame_alpha (struct frame *f);
-extern SETLAYEREDWINDOWATTRPROC SetLayeredWindowAttributes;
+extern SETLAYEREDWINDOWATTRPROC SetLayeredWindowAttributesProc;
#define CHECK_ALPHA_RANGE(alpha) if (alpha < 0 || alpha > 100) \
args_out_of_range (make_number (0), make_number (100));
@@ -1022,7 +1022,7 @@
int i, tmp;
Lisp_Object obj;
- if (SetLayeredWindowAttributes == NULL)
+ if (SetLayeredWindowAttributesProc == NULL)
return;
if (NILP (arg)
Index: src/editfns.c
===================================================================
--- src/editfns.c (revision 4248)
+++ src/editfns.c (working copy)
@@ -43,6 +43,9 @@
for <sys/resource.h>; thus systime.h must be included before
<sys/resource.h> */
#include "systime.h"
+#if _MSC_VER >= 1400
+#define tzname _tzname
+#endif
#if defined HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
Index: nt/meadow.rc
===================================================================
--- nt/meadow.rc (revision 4248)
+++ nt/meadow.rc (working copy)
@@ -8,7 +8,7 @@
// Generated from the TEXTINCLUDE 2 resource.
//
#ifndef __GNUC__
-#include "afxres.h"
+#include "winresrc.h"
#endif
/////////////////////////////////////////////////////////////////////////////
@@ -50,7 +50,7 @@
2 TEXTINCLUDE DISCARDABLE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""winresrc.h""\r\n"
"\0"
END
Index: nt/resource.h
===================================================================
--- nt/resource.h (revision 4248)
+++ nt/resource.h (working copy)
@@ -16,3 +16,8 @@
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
+
+#ifdef IDC_STATIC
+#undef IDC_STATIC
+#endif
+#define IDC_STATIC (-1)
Index: nt/nmake.mw32.defs
===================================================================
--- nt/nmake.mw32.defs (revision 4248)
+++ nt/nmake.mw32.defs (working copy)
@@ -114,7 +114,7 @@
RC_OUT = -Fo
RC_INCLUDE = -i
-libc = libc.lib
+libc = libcmt.lib
baselibs =
O = obj
A = lib
@@ -191,14 +191,14 @@
DEBUG_LINK =
!else
DEBUG_FLAG = -Zi
-DEBUG_LINK = -debug:full -debugtype:both
+DEBUG_LINK = -debug:full
!endif
!if "$(ARCH)" == "i386"
!ifdef NOOPT
-ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Od -G3d -Zp8 $(DEBUG_FLAG)
+ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Od -G3d -Zp8 -D_USE_32BIT_TIME_T $(DEBUG_FLAG)
!else
-ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF -Zp8 $(DEBUG_FLAG)
+ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF -Zp8 -D_USE_32BIT_TIME_T $(DEBUG_FLAG)
!endif
ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment