aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32.c
diff options
context:
space:
mode:
authorGlenn Morris2011-04-22 20:07:16 -0700
committerGlenn Morris2011-04-22 20:07:16 -0700
commit4ffd0d6b569d252e4e807d4e9c9d6a5bd5b08640 (patch)
tree26c20c7c4da56fae7e041c9345c76cce1224188c /src/w32.c
parent81de9236e1daa1fe7dfd0ef9aaaf1e13b6aa74e4 (diff)
parentbe71f8100a71a5b896ef05c32f51a09a3d9e3993 (diff)
downloademacs-4ffd0d6b569d252e4e807d4e9c9d6a5bd5b08640.tar.gz
emacs-4ffd0d6b569d252e4e807d4e9c9d6a5bd5b08640.zip
Merge from emacs-23; up to 2010-06-09T17:54:28Z!albinus@detlef.
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c
index d715c39fa81..85e4a2025b9 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
34#include <mbstring.h> /* for _mbspbrk */ 34#include <mbstring.h> /* for _mbspbrk */
35#include <math.h> 35#include <math.h>
36#include <setjmp.h> 36#include <setjmp.h>
37#include <time.h>
37 38
38/* must include CRT headers *before* config.h */ 39/* must include CRT headers *before* config.h */
39 40
@@ -62,6 +63,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
62 63
63#undef strerror 64#undef strerror
64 65
66#undef localtime
67
65#include "lisp.h" 68#include "lisp.h"
66 69
67#include <pwd.h> 70#include <pwd.h>
@@ -1942,6 +1945,12 @@ gettimeofday (struct timeval *tv, struct timezone *tz)
1942 1945
1943 tv->tv_sec = tb.time; 1946 tv->tv_sec = tb.time;
1944 tv->tv_usec = tb.millitm * 1000L; 1947 tv->tv_usec = tb.millitm * 1000L;
1948 /* Implementation note: _ftime sometimes doesn't update the dstflag
1949 according to the new timezone when the system timezone is
1950 changed. We could fix that by using GetSystemTime and
1951 GetTimeZoneInformation, but that doesn't seem necessary, since
1952 Emacs always calls gettimeofday with the 2nd argument NULL (see
1953 EMACS_GET_TIME). */
1945 if (tz) 1954 if (tz)
1946 { 1955 {
1947 tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ 1956 tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */
@@ -5678,6 +5687,19 @@ sys_write (int fd, const void * buffer, unsigned int count)
5678 return nchars; 5687 return nchars;
5679} 5688}
5680 5689
5690/* The Windows CRT functions are "optimized for speed", so they don't
5691 check for timezone and DST changes if they were last called less
5692 than 1 minute ago (see http://support.microsoft.com/kb/821231). So
5693 all Emacs features that repeatedly call time functions (e.g.,
5694 display-time) are in real danger of missing timezone and DST
5695 changes. Calling tzset before each localtime call fixes that. */
5696struct tm *
5697sys_localtime (const time_t *t)
5698{
5699 tzset ();
5700 return localtime (t);
5701}
5702
5681static void 5703static void
5682check_windows_init_file (void) 5704check_windows_init_file (void)
5683{ 5705{