Alexandre Julliard : msvcrt: Don't include msvcrt headers, instead duplicate the definitions in msvcrt.h.

Alexandre Julliard julliard at winehq.org
Fri Dec 12 07:04:08 CST 2008


Module: wine
Branch: master
Commit: 7a6c6747a90c8a105b8f3ecd868e99da822b9f07
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7a6c6747a90c8a105b8f3ecd868e99da822b9f07

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec 11 22:28:26 2008 +0100

msvcrt: Don't include msvcrt headers, instead duplicate the definitions in msvcrt.h.

---

 dlls/msvcrt/except.c        |   19 +++++++++----------
 dlls/msvcrt/locale.c        |    1 -
 dlls/msvcrt/main.c          |    1 -
 dlls/msvcrt/mbcs.c          |    1 -
 dlls/msvcrt/msvcrt.h        |   32 ++++++++++++++++++++++++++++++++
 dlls/msvcrt/tests/headers.c |   11 +++++++++++
 6 files changed, 52 insertions(+), 13 deletions(-)

diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c
index adcd18c..6a6fed3 100644
--- a/dlls/msvcrt/except.c
+++ b/dlls/msvcrt/except.c
@@ -33,7 +33,6 @@
 #include "msvcrt.h"
 #include "excpt.h"
 #include "wincon.h"
-#include "msvcrt/float.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(seh);
@@ -433,13 +432,13 @@ static const struct
     NTSTATUS status;
     int signal;
 } float_exception_map[] = {
- { EXCEPTION_FLT_DENORMAL_OPERAND, _FPE_DENORMAL },
- { EXCEPTION_FLT_DIVIDE_BY_ZERO, _FPE_ZERODIVIDE },
- { EXCEPTION_FLT_INEXACT_RESULT, _FPE_INEXACT },
- { EXCEPTION_FLT_INVALID_OPERATION, _FPE_INVALID },
- { EXCEPTION_FLT_OVERFLOW, _FPE_OVERFLOW },
- { EXCEPTION_FLT_STACK_CHECK, _FPE_STACKOVERFLOW },
- { EXCEPTION_FLT_UNDERFLOW, _FPE_UNDERFLOW },
+ { EXCEPTION_FLT_DENORMAL_OPERAND, MSVCRT__FPE_DENORMAL },
+ { EXCEPTION_FLT_DIVIDE_BY_ZERO, MSVCRT__FPE_ZERODIVIDE },
+ { EXCEPTION_FLT_INEXACT_RESULT, MSVCRT__FPE_INEXACT },
+ { EXCEPTION_FLT_INVALID_OPERATION, MSVCRT__FPE_INVALID },
+ { EXCEPTION_FLT_OVERFLOW, MSVCRT__FPE_OVERFLOW },
+ { EXCEPTION_FLT_STACK_CHECK, MSVCRT__FPE_STACKOVERFLOW },
+ { EXCEPTION_FLT_UNDERFLOW, MSVCRT__FPE_UNDERFLOW },
 };
 
 static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except)
@@ -479,7 +478,7 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except)
             if (handler != MSVCRT_SIG_IGN)
             {
                 unsigned int i;
-                int float_signal = _FPE_INVALID;
+                int float_signal = MSVCRT__FPE_INVALID;
 
                 sighandlers[MSVCRT_SIGFPE] = MSVCRT_SIG_DFL;
                 for (i = 0; i < sizeof(float_exception_map) /
@@ -581,7 +580,7 @@ int CDECL MSVCRT_raise(int sig)
         {
             sighandlers[sig] = MSVCRT_SIG_DFL;
             if (sig == MSVCRT_SIGFPE)
-                ((float_handler)handler)(sig, _FPE_EXPLICITGEN);
+                ((float_handler)handler)(sig, MSVCRT__FPE_EXPLICITGEN);
             else
                 handler(sig);
         }
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 350e057..1d27eaf 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -32,7 +32,6 @@
 
 #include "msvcrt.h"
 #include "mtdll.h"
-#include "msvcrt/mbctype.h"
 
 #include "wine/debug.h"
 
diff --git a/dlls/msvcrt/main.c b/dlls/msvcrt/main.c
index c807209..598c2a4 100644
--- a/dlls/msvcrt/main.c
+++ b/dlls/msvcrt/main.c
@@ -18,7 +18,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 #include "msvcrt.h"
-#include "msvcrt/mbctype.h"
 
 #include "wine/debug.h"
 
diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c
index c99d167..22cfea0 100644
--- a/dlls/msvcrt/mbcs.c
+++ b/dlls/msvcrt/mbcs.c
@@ -26,7 +26,6 @@
 #include "msvcrt.h"
 #include "wine/unicode.h"
 #include "wine/debug.h"
-#include "msvcrt/mbctype.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index 97d60d6..0fadac4 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -598,6 +598,36 @@ typedef void (*MSVCRT___sighandler_t)(int);
 #define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
 #define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
 
+#define MSVCRT__FPE_INVALID            0x81
+#define MSVCRT__FPE_DENORMAL           0x82
+#define MSVCRT__FPE_ZERODIVIDE         0x83
+#define MSVCRT__FPE_OVERFLOW           0x84
+#define MSVCRT__FPE_UNDERFLOW          0x85
+#define MSVCRT__FPE_INEXACT            0x86
+#define MSVCRT__FPE_UNEMULATED         0x87
+#define MSVCRT__FPE_SQRTNEG            0x88
+#define MSVCRT__FPE_STACKOVERFLOW      0x8a
+#define MSVCRT__FPE_STACKUNDERFLOW     0x8b
+#define MSVCRT__FPE_EXPLICITGEN        0x8c
+
+#define _MS     0x01
+#define _MP     0x02
+#define _M1     0x04
+#define _M2     0x08
+
+#define _SBUP   0x10
+#define _SBLOW  0x20
+
+#define _MBC_SINGLE     0
+#define _MBC_LEAD       1
+#define _MBC_TRAIL      2
+#define _MBC_ILLEGAL    -1
+
+#define _MB_CP_SBCS     0
+#define _MB_CP_OEM      -2
+#define _MB_CP_ANSI     -3
+#define _MB_CP_LOCALE   -4
+
 void  __cdecl    MSVCRT_free(void*);
 void* __cdecl    MSVCRT_malloc(MSVCRT_size_t);
 void* __cdecl    MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
@@ -637,6 +667,7 @@ int            __cdecl MSVCRT_raise(int sig);
 #ifndef __WINE_MSVCRT_TEST
 int            __cdecl MSVCRT__write(int,const void*,unsigned int);
 int            __cdecl _getch(void);
+int            __cdecl _ismbblead(unsigned int);
 int            __cdecl _ismbstrail(const unsigned char* start, const unsigned char* str);
 MSVCRT_intptr_t __cdecl _spawnve(int,const char*,const char* const *,const char* const *);
 MSVCRT_intptr_t __cdecl _spawnvpe(int,const char*,const char* const *,const char* const *);
@@ -657,6 +688,7 @@ MSVCRT_wchar_t* __cdecl _wcsdup(const MSVCRT_wchar_t*);
 MSVCRT_wchar_t*** __cdecl __p__wenviron(void);
 char*   __cdecl _strdate(char* date);
 char*   __cdecl _strtime(char* date);
+int     __cdecl _setmbcp(int);
 void    __cdecl _ftime(struct MSVCRT__timeb *buf);
 int     __cdecl MSVCRT__close(int);
 int     __cdecl MSVCRT__dup(int);
diff --git a/dlls/msvcrt/tests/headers.c b/dlls/msvcrt/tests/headers.c
index d7c7cd7..c9e9570 100644
--- a/dlls/msvcrt/tests/headers.c
+++ b/dlls/msvcrt/tests/headers.c
@@ -462,6 +462,17 @@ static void test_defines(void)
     CHECK_DEF(SIGBREAK);
     CHECK_DEF(SIGABRT);
     CHECK_DEF(NSIG);
+    CHECK_DEF(_FPE_INVALID);
+    CHECK_DEF(_FPE_DENORMAL);
+    CHECK_DEF(_FPE_ZERODIVIDE);
+    CHECK_DEF(_FPE_OVERFLOW);
+    CHECK_DEF(_FPE_UNDERFLOW);
+    CHECK_DEF(_FPE_INEXACT);
+    CHECK_DEF(_FPE_UNEMULATED);
+    CHECK_DEF(_FPE_SQRTNEG);
+    CHECK_DEF(_FPE_STACKOVERFLOW);
+    CHECK_DEF(_FPE_STACKUNDERFLOW);
+    CHECK_DEF(_FPE_EXPLICITGEN);
 #ifdef __i386__
     CHECK_DEF(_EM_INVALID);
     CHECK_DEF(_EM_DENORMAL);




More information about the wine-cvs mailing list