From 82d1a8fb73d5da2b9ff2bdec6243153b4f73992f Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Thu, 3 Feb 2000 01:04:39 +0000 Subject: [PATCH] Moved definitions such as BOOL16 and INT16 from windef.h into wine/windef16.h. --- include/windef.h | 62 +++------------------ include/wine/windef16.h | 120 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 55 deletions(-) create mode 100644 include/wine/windef16.h diff --git a/include/windef.h b/include/windef.h index f9af7b26fd0..970cf33e62f 100644 --- a/include/windef.h +++ b/include/windef.h @@ -140,8 +140,6 @@ extern "C" { /* Standard data types. These are the same for emulator and library. */ typedef void VOID; -typedef short INT16; -typedef unsigned short UINT16; typedef int INT; typedef unsigned int UINT; typedef unsigned short WORD; @@ -155,7 +153,6 @@ typedef char CHAR; typedef unsigned char UCHAR; /* Some systems might have wchar_t, but we really need 16 bit characters */ typedef unsigned short WCHAR; -typedef unsigned short BOOL16; typedef int BOOL; typedef double DATE; typedef double DOUBLE; @@ -170,18 +167,15 @@ typedef double ULONGLONG; * they exist as void*. If there is a size difference between UINT and * void* then things get ugly. */ #ifdef STRICT -typedef UINT16 HANDLE16; typedef VOID* HANDLE; #else -typedef UINT16 HANDLE16; typedef UINT HANDLE; #endif -typedef HANDLE16 *LPHANDLE16; + typedef HANDLE *LPHANDLE; /* Integer types. These are the same for emulator and library. */ -typedef UINT16 WPARAM16; typedef UINT WPARAM; typedef LONG LPARAM; typedef LONG HRESULT; @@ -222,8 +216,6 @@ typedef DWORD *LPDWORD; typedef LONG *LPLONG; typedef VOID *LPVOID; typedef const VOID *LPCVOID; -typedef INT16 *LPINT16; -typedef UINT16 *LPUINT16; typedef INT *PINT; typedef INT *LPINT; typedef UINT *PUINT; @@ -245,19 +237,11 @@ typedef void* SEGPTR; #ifdef STRICT #define DECLARE_HANDLE(a) \ - typedef HANDLE16 a##16; \ - typedef a##16 *P##a##16; \ - typedef a##16 *NP##a##16; \ - typedef a##16 *LP##a##16; \ typedef struct a##__ { int unused; } *a; \ typedef a *P##a; \ typedef a *LP##a #else /*STRICT*/ #define DECLARE_HANDLE(a) \ - typedef HANDLE16 a##16; \ - typedef a##16 *P##a##16; \ - typedef a##16 *NP##a##16; \ - typedef a##16 *LP##a##16; \ typedef HANDLE a; \ typedef a *P##a; \ typedef a *LP##a @@ -312,11 +296,7 @@ DECLARE_HANDLE(HRASCONN); /* Handle types that must remain interchangeable even with strict on */ -typedef HINSTANCE16 HMODULE16; typedef HINSTANCE HMODULE; -typedef HANDLE16 HGDIOBJ16; -typedef HANDLE16 HGLOBAL16; -typedef HANDLE16 HLOCAL16; typedef HANDLE HGDIOBJ; typedef HANDLE HGLOBAL; typedef HANDLE HLOCAL; @@ -326,23 +306,15 @@ typedef HANDLE HLOCAL; typedef BOOL (CALLBACK* DATEFMT_ENUMPROCA)(LPSTR); typedef BOOL (CALLBACK* DATEFMT_ENUMPROCW)(LPWSTR); DECL_WINELIB_TYPE_AW(DATEFMT_ENUMPROC) -typedef BOOL16 (CALLBACK *DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM); typedef BOOL (CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM); -typedef LRESULT (CALLBACK *DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM); typedef LRESULT (CALLBACK *DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM); -typedef INT16 (CALLBACK *EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16); typedef INT (CALLBACK *EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT); typedef INT (CALLBACK *EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT); DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC) -typedef LRESULT (CALLBACK *FARPROC16)(); typedef LRESULT (CALLBACK *FARPROC)(); -typedef INT16 (CALLBACK *PROC16)(); typedef INT (CALLBACK *PROC)(); -typedef BOOL16 (CALLBACK *GRAYSTRINGPROC16)(HDC16,LPARAM,INT16); typedef BOOL (CALLBACK *GRAYSTRINGPROC)(HDC,LPARAM,INT); -typedef LRESULT (CALLBACK *HOOKPROC16)(INT16,WPARAM16,LPARAM); typedef LRESULT (CALLBACK *HOOKPROC)(INT,WPARAM,LPARAM); -typedef BOOL16 (CALLBACK *PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16); typedef BOOL (CALLBACK *PROPENUMPROCA)(HWND,LPCSTR,HANDLE); typedef BOOL (CALLBACK *PROPENUMPROCW)(HWND,LPCWSTR,HANDLE); DECL_WINELIB_TYPE_AW(PROPENUMPROC) @@ -352,13 +324,16 @@ DECL_WINELIB_TYPE_AW(PROPENUMPROCEX) typedef BOOL (CALLBACK* TIMEFMT_ENUMPROCA)(LPSTR); typedef BOOL (CALLBACK* TIMEFMT_ENUMPROCW)(LPWSTR); DECL_WINELIB_TYPE_AW(TIMEFMT_ENUMPROC) -typedef VOID (CALLBACK *TIMERPROC16)(HWND16,UINT16,UINT16,DWORD); typedef VOID (CALLBACK *TIMERPROC)(HWND,UINT,UINT,DWORD); -typedef LRESULT (CALLBACK *WNDENUMPROC16)(HWND16,LPARAM); typedef LRESULT (CALLBACK *WNDENUMPROC)(HWND,LPARAM); -typedef LRESULT (CALLBACK *WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM); typedef LRESULT (CALLBACK *WNDPROC)(HWND,UINT,WPARAM,LPARAM); +/*---------------------------------------------------------------------------- +** FIXME: Better isolate Wine's reliance on the xxx16 type definitions. +** For now, we just isolate them to make the situation clear. +**--------------------------------------------------------------------------*/ +#include "wine/windef16.h" + /* Define some empty macros for compatibility with Windows code. */ #ifndef __WINE__ @@ -472,13 +447,6 @@ typedef LRESULT (CALLBACK *WNDPROC)(HWND,UINT,WPARAM,LPARAM); #define HFILE_ERROR ((HFILE)-1) /* The SIZE structure */ - -typedef struct -{ - INT16 cx; - INT16 cy; -} SIZE16, *PSIZE16, *LPSIZE16; - typedef struct tagSIZE { INT cx; @@ -494,13 +462,6 @@ typedef SIZE SIZEL, *PSIZEL, *LPSIZEL; ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy) /* The POINT structure */ - -typedef struct -{ - INT16 x; - INT16 y; -} POINT16, *PPOINT16, *LPPOINT16; - typedef struct tagPOINT { LONG x; @@ -533,15 +494,6 @@ typedef struct tagPOINTS /* The RECT structure */ - -typedef struct -{ - INT16 left; - INT16 top; - INT16 right; - INT16 bottom; -} RECT16, *LPRECT16; - typedef struct tagRECT { INT left; diff --git a/include/wine/windef16.h b/include/wine/windef16.h new file mode 100644 index 00000000000..156eccab0e3 --- /dev/null +++ b/include/wine/windef16.h @@ -0,0 +1,120 @@ +/* + * Basic type definitions for 16 bit variations on Windows types. + * These types are provided mostly to insure compatibility with + * 16 bit windows code. + */ + +#ifndef __WINE_WINDEF16_H +#define __WINE_WINDEF16_H + +/* Standard data types */ + +typedef short INT16; +typedef unsigned short UINT16; +typedef unsigned short BOOL16; + +typedef UINT16 HANDLE16; +typedef HANDLE16 *LPHANDLE16; + +typedef UINT16 WPARAM16; +typedef INT16 *LPINT16; +typedef UINT16 *LPUINT16; + +#define DECLARE_HANDLE16(a) \ + typedef HANDLE16 a##16; \ + typedef a##16 *P##a##16; \ + typedef a##16 *NP##a##16; \ + typedef a##16 *LP##a##16; + +DECLARE_HANDLE16(HACMDRIVERID); +DECLARE_HANDLE16(HACMDRIVER); +DECLARE_HANDLE16(HACMOBJ); +DECLARE_HANDLE16(HACMSTREAM); +DECLARE_HANDLE16(HMETAFILEPICT); + +DECLARE_HANDLE16(HACCEL); +DECLARE_HANDLE16(HBITMAP); +DECLARE_HANDLE16(HBRUSH); +DECLARE_HANDLE16(HCOLORSPACE); +DECLARE_HANDLE16(HCURSOR); +DECLARE_HANDLE16(HDC); +DECLARE_HANDLE16(HDROP); +DECLARE_HANDLE16(HDRVR); +DECLARE_HANDLE16(HDWP); +DECLARE_HANDLE16(HENHMETAFILE); +DECLARE_HANDLE16(HFILE); +DECLARE_HANDLE16(HFONT); +DECLARE_HANDLE16(HICON); +DECLARE_HANDLE16(HINSTANCE); +DECLARE_HANDLE16(HKEY); +DECLARE_HANDLE16(HMENU); +DECLARE_HANDLE16(HMETAFILE); +DECLARE_HANDLE16(HMIDI); +DECLARE_HANDLE16(HMIDIIN); +DECLARE_HANDLE16(HMIDIOUT); +DECLARE_HANDLE16(HMIDISTRM); +DECLARE_HANDLE16(HMIXER); +DECLARE_HANDLE16(HMIXEROBJ); +DECLARE_HANDLE16(HMMIO); +DECLARE_HANDLE16(HPALETTE); +DECLARE_HANDLE16(HPEN); +DECLARE_HANDLE16(HQUEUE); +DECLARE_HANDLE16(HRGN); +DECLARE_HANDLE16(HRSRC); +DECLARE_HANDLE16(HTASK); +DECLARE_HANDLE16(HWAVE); +DECLARE_HANDLE16(HWAVEIN); +DECLARE_HANDLE16(HWAVEOUT); +DECLARE_HANDLE16(HWINSTA); +DECLARE_HANDLE16(HDESK); +DECLARE_HANDLE16(HWND); +DECLARE_HANDLE16(HKL); +DECLARE_HANDLE16(HIC); +DECLARE_HANDLE16(HRASCONN); +#undef DECLARE_HANDLE16 + +typedef HINSTANCE16 HMODULE16; +typedef HANDLE16 HGDIOBJ16; +typedef HANDLE16 HGLOBAL16; +typedef HANDLE16 HLOCAL16; + +/* The SIZE structure */ +typedef struct +{ + INT16 cx; + INT16 cy; +} SIZE16, *PSIZE16, *LPSIZE16; + +/* The POINT structure */ + +typedef struct +{ + INT16 x; + INT16 y; +} POINT16, *PPOINT16, *LPPOINT16; + +/* The RECT structure */ + +typedef struct +{ + INT16 left; + INT16 top; + INT16 right; + INT16 bottom; +} RECT16, *LPRECT16; + +/* Callback function pointers types */ + +typedef LRESULT (CALLBACK *DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM); +typedef BOOL16 (CALLBACK *DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM); +typedef INT16 (CALLBACK *EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16); +typedef LRESULT (CALLBACK *FARPROC16)(); +typedef INT16 (CALLBACK *PROC16)(); +typedef BOOL16 (CALLBACK *GRAYSTRINGPROC16)(HDC16,LPARAM,INT16); +typedef LRESULT (CALLBACK *HOOKPROC16)(INT16,WPARAM16,LPARAM); +typedef BOOL16 (CALLBACK *PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16); +typedef VOID (CALLBACK *TIMERPROC16)(HWND16,UINT16,UINT16,DWORD); +typedef LRESULT (CALLBACK *WNDENUMPROC16)(HWND16,LPARAM); +typedef LRESULT (CALLBACK *WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM); + +#endif /* __WINE_WINDEF16_H */