3/4 patches for compilation of ATL MFC

2004-03-11 Thread Boaz Harrosh
PATCH 3
msvcrt.diff
  minor fixes to msvcrt
- include/msvcrt/limits.h
   very much synced with MSVC, needed by MFC
- include/msvcrt/math.h
   I'm not sure who submitted a broken empty math.h header. Just to show that no one 
is doing serious winlib work lately, or they are not reporting about it. This header 
is the one I have for use with STLPort, it will Just #include the standard lib one. If 
it is not acceptable than at least completely remove the one in now.
- include/msvcrt/mbctype.h
   Some missing constants for the _setmbcp, used by MFC
- include/msvcrt/wchar.h
   Some code was copy pasted from sys/stat.h and was protected by an #ifndef. The 
sys/stat.h added some newer definitions that where not added to wchar. This patch removes the 
old definitions and instead #includes sys/stat.h. It is the same way in ms-headers. In fact I 
had some code that presupposed stat.h included by wchar that would hence not compile under the old 
version.


? include/msvcrt/exception
? include/msvcrt/float.h
? include/msvcrt/new
? include/msvcrt/stdarg.h
? include/msvcrt/typeinfo

Index: include/msvcrt/limits.h
===
RCS file: /home/wine/wine/include/msvcrt/limits.h,v
retrieving revision 1.1
diff -u -r1.1 limits.h
--- include/msvcrt/limits.h 2 Sep 2003 00:58:21 -   1.1
+++ include/msvcrt/limits.h 10 Mar 2004 08:36:47 -
@@ -1,10 +1,32 @@
 #ifndef __WINE_LIMITS_H
 #define __WINE_LIMITS_H

-#define INT_MAX  2147483647
-#define INT_MIN  (-2147483648)
-#define SHRT_MAX 32767
-#define SHRT_MIN (-32768)
+/*chars and mb's*/
+#define CHAR_BIT  8
+#define CHAR_MIN   (-128)
+#define CHAR_MAX   127
+#define SCHAR_MIN   (-128)
+#define SCHAR_MAX 127
+#define UCHAR_MIN 0
+#define UCHAR_MAX 0xff
+#define MB_LEN_MAX2
+
+/*shorts ints longs*/
+#define SHRT_MIN   0x8000
+#define SHRT_MAX   0x0fff
+
+#define USHRT_MAX 0x
+#define INT_MIN (-2147483647 - 1)
+#define INT_MAX   2147483647
+#define UINT_MAX  0x
+#define LONG_MIN(-2147483647L - 1)
+#define LONG_MAX  2147483647L
+#define ULONG_MAX 0xUL
+
+/* __int64 */
+#define _I64_MIN(-9223372036854775807i64 - 1)
+#define _I64_MAX  9223372036854775807i64
+#define _UI64_MAX 0xui64

 #ifdef __cplusplus
 extern C {
Index: include/msvcrt/math.h
===
RCS file: /home/wine/wine/include/msvcrt/math.h,v
retrieving revision 1.1
diff -u -r1.1 math.h
--- include/msvcrt/math.h   2 Sep 2003 00:58:21 -   1.1
+++ include/msvcrt/math.h   10 Mar 2004 08:36:47 -
@@ -1,12 +1,14 @@
-#ifndef __WINE_MATH_H
-#define __WINE_MATH_H

-#ifdef __cplusplus
-extern C {
-#endif
+#include ../include/math.h
 
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __WINE_MATH_H */
Index: include/msvcrt/mbctype.h
===
RCS file: /home/wine/wine/include/msvcrt/mbctype.h,v
retrieving revision 1.4
diff -u -r1.4 mbctype.h
--- include/msvcrt/mbctype.h18 Jul 2003 22:57:15 -  1.4
+++ include/msvcrt/mbctype.h10 Mar 2004 08:36:47 -
@@ -30,6 +30,12 @@
 unsigned char* __p__mbctype(void);
 #define _mbctype   (__p__mbctype())
 
+/* _setmbcp parameter defines */
+#define _MB_CP_SBCS 0
+#define _MB_CP_OEM  -2
+#define _MB_CP_ANSI -3
+#define _MB_CP_LOCALE   -4
+
 int _getmbcp(void);
 int _ismbbalnum(unsigned int);
 int _ismbbalpha(unsigned int);
Index: include/msvcrt/wchar.h
===
RCS file: /home/wine/wine/include/msvcrt/wchar.h,v
retrieving revision 1.5
diff -u -r1.5 wchar.h
--- include/msvcrt/wchar.h  18 Jul 2003 22:57:15 -  1.5
+++ include/msvcrt/wchar.h  10 Mar 2004 08:36:48 -
@@ -151,35 +151,7 @@
 #endif /* MSVCRT_WFINDDATA_T_DEFINED */
 
 #ifndef MSVCRT_STAT_DEFINED
-#define MSVCRT_STAT_DEFINED
-
-struct _stat {
-  _dev_t st_dev;
-  _ino_t st_ino;
-  unsigned short st_mode;
-  short  st_nlink;
-  short  st_uid;
-  short  st_gid;
-  _dev_t st_rdev;
-  MSVCRT(_off_t) st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
-};
-
-struct _stati64 {
-  _dev_t st_dev;
-  _ino_t st_ino;
-  unsigned short st_mode;
-  short  st_nlink;
-  short  st_uid;
-  short  st_gid;
-  _dev_t st_rdev;
-  __int64st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
-};
+#include sys/stat.h
 #endif /* MSVCRT_STAT_DEFINED */

 /* ASCII char classification table - binary compatible */




Re: 3/4 patches for compilation of ATL MFC

2004-03-11 Thread Alexandre Julliard
Boaz Harrosh [EMAIL PROTECTED] writes:

 +#define _I64_MIN(-9223372036854775807i64 - 1)
 +#define _I64_MAX  9223372036854775807i64
 +#define _UI64_MAX 0xui64

The i64 suffix is not portable.

 --- include/msvcrt/math.h 2 Sep 2003 00:58:21 -   1.1
 +++ include/msvcrt/math.h 10 Mar 2004 08:36:47 -
 @@ -1,12 +1,14 @@
 -#ifndef __WINE_MATH_H
 -#define __WINE_MATH_H

 -#ifdef __cplusplus
 -extern C {
 -#endif
 +#include ../include/math.h

This is wrong, we need a proper math.h.

-- 
Alexandre Julliard
[EMAIL PROTECTED]