Msvcrt fixes
François Gouget
fgouget at codeweavers.com
Mon Apr 23 02:27:58 CDT 2001
Changelog:
* include/msvcrt/stddef.h
Adding offsetof (for the MFC)
* dlls/msvcrt/time.c
We must not free the pointer returned by localtime (especially not
with MSVCRT_free!).
We no longer need to include stdlib.h
* dlls/msvcrt/string.c
Cosmetic changes
Btw, the Linux localtime documentation sucks. It's even worse than
the MS one!!!
--
François Gouget
fgouget at codeweavers.com
-------------- next part --------------
Index: include/msvcrt/stddef.h
===================================================================
RCS file: /home/wine/wine/include/msvcrt/stddef.h,v
retrieving revision 1.1
diff -u -r1.1 stddef.h
--- include/msvcrt/stddef.h 2001/04/10 23:21:43 1.1
+++ include/msvcrt/stddef.h 2001/04/21 22:27:01
@@ -19,6 +19,9 @@
/* Best to leave this one alone: wchar_t */
+#define offsetof(s,m) (size_t)&(((s*)NULL)->m)
+
+
#ifdef __cplusplus
extern "C" {
#endif
Index: dlls/msvcrt/time.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/time.c,v
retrieving revision 1.4
diff -u -r1.4 time.c
--- dlls/msvcrt/time.c 2001/04/16 18:54:31 1.4
+++ dlls/msvcrt/time.c 2001/04/23 04:13:32
@@ -6,11 +6,11 @@
* Copyright 1997,2000 Uwe Bonnes
* Copyright 2000 Jon Griffiths
*/
+
#include <time.h>
#include <sys/times.h>
-#include "msvcrt.h"
-#include "msvcrt/stdlib.h"
+#include "msvcrt.h"
#include "msvcrt/sys/timeb.h"
#include "msvcrt/time.h"
@@ -29,8 +29,6 @@
if (time(&t) != bad_time && (_tm = localtime(&t)) &&
strftime(out,9,format,_tm) == 8)
retval = out;
- if (_tm)
- MSVCRT_free(_tm);
return retval;
}
Index: dlls/msvcrt/string.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/string.c,v
retrieving revision 1.3
diff -u -r1.3 string.c
--- dlls/msvcrt/string.c 2001/04/10 23:25:25 1.3
+++ dlls/msvcrt/string.c 2001/04/23 02:29:09
@@ -6,8 +6,8 @@
* Copyright 1997,2000 Uwe Bonnes
* Copyright 2000 Jon Griffiths
*/
-#include "msvcrt.h"
+#include "msvcrt.h"
#include "msvcrt/stdlib.h"
#include "msvcrt/string.h"
More information about the wine-patches
mailing list