Moved the NONAMELESSUNION/STRUCT macros to wine/test.h so that they

can be used in all the test.
This commit is contained in:
Alexandre Julliard 2005-06-13 12:10:54 +00:00
parent d4eb4f54ed
commit c2d5b444b3
11 changed files with 42 additions and 99 deletions

View File

@ -23,18 +23,6 @@
#include "ddraw.h"
#include "d3d.h"
#ifdef NONAMELESSUNION
# define U(x) (x).u
# define U1(x) (x).u1
# define U2(x) (x).u2
# define U3(x) (x).u3
#else
# define U(x) (x)
# define U1(x) (x)
# define U2(x) (x)
# define U3(x) (x)
#endif
static LPDIRECTDRAW7 lpDD = NULL;
static LPDIRECT3D7 lpD3D = NULL;
static LPDIRECTDRAWSURFACE7 lpDDS = NULL;

View File

@ -22,12 +22,6 @@
#include "wine/test.h"
#include "ddraw.h"
#ifdef NONAMELESSUNION
#define UNION_MEMBER(x, y) DUMMYUNIONNAME##x.y
#else
#define UNION_MEMBER(x, y) y
#endif
static LPDIRECTDRAW lpDD = NULL;
static LPDIRECTDRAWSURFACE lpDDSPrimary = NULL;
static LPDIRECTDRAWSURFACE lpDDSBack = NULL;
@ -100,7 +94,7 @@ HRESULT WINAPI enummodescallback(LPDDSURFACEDESC lpddsd, LPVOID lpContext)
{
trace("Width = %li, Height = %li, Refresh Rate = %li\r\n",
lpddsd->dwWidth, lpddsd->dwHeight,
lpddsd->UNION_MEMBER(2, dwRefreshRate));
U2(*lpddsd).dwRefreshRate);
adddisplaymode(lpddsd);
return DDENUMRET_OK;
@ -134,7 +128,7 @@ static void setdisplaymode(int i)
{
rc = IDirectDraw_SetDisplayMode(lpDD,
modes[i].dwWidth, modes[i].dwHeight,
modes[i].ddpfPixelFormat.UNION_MEMBER(1, dwRGBBitCount));
U1(modes[i].ddpfPixelFormat).dwRGBBitCount);
ok(DD_OK==rc || DDERR_UNSUPPORTED==rc,"SetDisplayMode returned: %lx\n",rc);
if (DD_OK==rc) {
rc = IDirectDraw_RestoreDisplayMode(lpDD);

View File

@ -22,14 +22,6 @@
#include "wine/test.h"
#include "ddraw.h"
#ifdef NONAMELESSUNION
# define U(x) (x).u
# define U2(x) (x).u2
#else
# define U(x) (x)
# define U2(x) (x)
#endif
static LPDIRECTDRAW lpDD = NULL;
static void CreateDirectDraw()

View File

@ -28,17 +28,6 @@
#include "winbase.h"
#include "winerror.h"
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
#ifdef NONAMELESSSTRUCT
# define S(x) (x).s
#else
# define S(x) (x)
#endif
static int dll_capable(const char *dll, const char *function)
{
HMODULE module = GetModuleHandleA(dll);

View File

@ -22,12 +22,6 @@
#include "wine/test.h"
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
/* invalid in all versions */
#define PROP_INV 255
/* valid in v0 and above (NT4+) */

View File

@ -20,12 +20,6 @@
#include "objbase.h"
#include "wine/test.h"
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
static HRESULT (WINAPI *pFmtIdToPropStgName)(const FMTID *, LPOLESTR);
static HRESULT (WINAPI *pPropStgNameToFmtId)(const LPOLESTR, FMTID *);
static HRESULT (WINAPI *pStgCreatePropSetStg)(IStorage *, DWORD, IPropertySetStorage **);

View File

@ -39,21 +39,6 @@
static HMODULE hOleaut32;
#ifdef NONAMELESSUNION
# define U(x) (x).u
# define U1(x) (x).u1
#else
# define U(x) (x)
# define U1(x) (x)
#endif
#ifdef NONAMELESSSTRUCT
# define S(x) (x).s
# define S1(x) (x).s1
#else
# define S(x) (x)
# define S1(x) (x)
#endif
static HRESULT (WINAPI *pVarUdateFromDate)(DATE,ULONG,UDATE*);
static HRESULT (WINAPI *pVarDateFromUdate)(UDATE*,ULONG,DATE*);
static INT (WINAPI *pSystemTimeToVariantTime)(LPSYSTEMTIME,double*);

View File

@ -44,21 +44,6 @@
static HMODULE hOleaut32;
#ifdef NONAMELESSUNION
# define U(x) (x).u
# define U1(x) (x).u1
#else
# define U(x) (x)
# define U1(x) (x)
#endif
#ifdef NONAMELESSSTRUCT
# define S(x) (x).s
# define S1(x) (x).s1
#else
# define S(x) (x)
# define S1(x) (x)
#endif
/* Get a conversion function ptr, return if function not available */
#define CHECKPTR(func) p##func = (void*)GetProcAddress(hOleaut32, #func); \
if (!p##func) { \

View File

@ -29,12 +29,6 @@
#include "wine/test.h"
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
static const WCHAR TEST_URL_1[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','\0'};
static const WCHAR TEST_PART_URL_1[] = {'/','t','e','s','t','/','\0'};

View File

@ -36,18 +36,6 @@
#include "winmm_test.h"
#ifdef NONAMELESSSTRUCT
# define S1(x) (x).s1
#else
# define S1(x) (x)
#endif
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
static const char * line_flags(DWORD fdwLine)
{
static char flags[100];

View File

@ -23,6 +23,7 @@
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
/* debug level */
extern int winetest_debug;
@ -72,6 +73,45 @@ extern void winetest_trace( const char *msg, ... );
#define todo_wine todo("wine")
#ifdef NONAMELESSUNION
# define U(x) (x).u
# define U1(x) (x).u1
# define U2(x) (x).u2
# define U3(x) (x).u3
# define U4(x) (x).u4
# define U5(x) (x).u5
# define U6(x) (x).u6
# define U7(x) (x).u7
# define U8(x) (x).u8
#else
# define U(x) (x)
# define U1(x) (x)
# define U2(x) (x)
# define U3(x) (x)
# define U4(x) (x)
# define U5(x) (x)
# define U6(x) (x)
# define U7(x) (x)
# define U8(x) (x)
#endif
#ifdef NONAMELESSSTRUCT
# define S(x) (x).s
# define S1(x) (x).s1
# define S2(x) (x).s2
# define S3(x) (x).s3
# define S4(x) (x).s4
# define S5(x) (x).s5
#else
# define S(x) (x)
# define S1(x) (x)
# define S2(x) (x)
# define S3(x) (x)
# define S4(x) (x)
# define S5(x) (x)
#endif
/************************************************************************/
/* Below is the implementation of the various functions, to be included
* directly into the generated testlist.c file.