From 43c18c132183a55dcf0454ffd3600f76e94b5d13 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Thu, 8 Jan 2009 00:18:48 +0100 Subject: [PATCH] winapi_test: FIELD_ALIGNMENT() is redundant so remove it. --- dlls/gdi32/tests/generated.c | 16 ++++------------ dlls/kernel32/tests/generated.c | 16 ++++------------ dlls/ntdll/tests/generated.c | 16 ++++------------ dlls/rpcrt4/tests/generated.c | 16 ++++------------ dlls/shell32/tests/generated.c | 16 ++++------------ dlls/shlwapi/tests/generated.c | 16 ++++------------ dlls/urlmon/tests/generated.c | 16 ++++------------ dlls/user32/tests/generated.c | 16 ++++------------ dlls/wininet/tests/generated.c | 16 ++++------------ tools/winapi/winapi_test | 16 ++++------------ 10 files changed, 40 insertions(+), 120 deletions(-) diff --git a/dlls/gdi32/tests/generated.c b/dlls/gdi32/tests/generated.c index 632d6420b06..758851dbd7c 100644 --- a/dlls/gdi32/tests/generated.c +++ b/dlls/gdi32/tests/generated.c @@ -27,22 +27,14 @@ * Windows API extension */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -61,9 +53,9 @@ #ifdef FIELD_ALIGNMENT # define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ + ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \ "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) + (int)_TYPE_ALIGNMENT(((type*)0)->field)) #else # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) #endif diff --git a/dlls/kernel32/tests/generated.c b/dlls/kernel32/tests/generated.c index fe1c6c8a6d0..a5a84c4e78e 100644 --- a/dlls/kernel32/tests/generated.c +++ b/dlls/kernel32/tests/generated.c @@ -27,22 +27,14 @@ * Windows API extension */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -61,9 +53,9 @@ #ifdef FIELD_ALIGNMENT # define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ + ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \ "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) + (int)_TYPE_ALIGNMENT(((type*)0)->field)) #else # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) #endif diff --git a/dlls/ntdll/tests/generated.c b/dlls/ntdll/tests/generated.c index c854d5b4daf..08195222c15 100644 --- a/dlls/ntdll/tests/generated.c +++ b/dlls/ntdll/tests/generated.c @@ -27,22 +27,14 @@ * Windows API extension */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -61,9 +53,9 @@ #ifdef FIELD_ALIGNMENT # define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ + ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \ "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) + (int)_TYPE_ALIGNMENT(((type*)0)->field)) #else # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) #endif diff --git a/dlls/rpcrt4/tests/generated.c b/dlls/rpcrt4/tests/generated.c index c5b69a86f0d..7296970cfb1 100644 --- a/dlls/rpcrt4/tests/generated.c +++ b/dlls/rpcrt4/tests/generated.c @@ -32,22 +32,14 @@ * Windows API extension */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -66,9 +58,9 @@ #ifdef FIELD_ALIGNMENT # define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ + ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \ "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) + (int)_TYPE_ALIGNMENT(((type*)0)->field)) #else # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) #endif diff --git a/dlls/shell32/tests/generated.c b/dlls/shell32/tests/generated.c index 21520215471..a3c9727f5b9 100644 --- a/dlls/shell32/tests/generated.c +++ b/dlls/shell32/tests/generated.c @@ -34,22 +34,14 @@ * Windows API extension */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -68,9 +60,9 @@ #ifdef FIELD_ALIGNMENT # define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ + ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \ "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) + (int)_TYPE_ALIGNMENT(((type*)0)->field)) #else # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) #endif diff --git a/dlls/shlwapi/tests/generated.c b/dlls/shlwapi/tests/generated.c index 1ac8811a889..0b52d65fb15 100644 --- a/dlls/shlwapi/tests/generated.c +++ b/dlls/shlwapi/tests/generated.c @@ -32,22 +32,14 @@ * Windows API extension */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -66,9 +58,9 @@ #ifdef FIELD_ALIGNMENT # define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ + ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \ "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) + (int)_TYPE_ALIGNMENT(((type*)0)->field)) #else # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) #endif diff --git a/dlls/urlmon/tests/generated.c b/dlls/urlmon/tests/generated.c index a0272050846..61233cd1247 100644 --- a/dlls/urlmon/tests/generated.c +++ b/dlls/urlmon/tests/generated.c @@ -30,22 +30,14 @@ * Windows API extension */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -64,9 +56,9 @@ #ifdef FIELD_ALIGNMENT # define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ + ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \ "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) + (int)_TYPE_ALIGNMENT(((type*)0)->field)) #else # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) #endif diff --git a/dlls/user32/tests/generated.c b/dlls/user32/tests/generated.c index 423bc08cd66..be1796f387d 100644 --- a/dlls/user32/tests/generated.c +++ b/dlls/user32/tests/generated.c @@ -27,22 +27,14 @@ * Windows API extension */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -61,9 +53,9 @@ #ifdef FIELD_ALIGNMENT # define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ + ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \ "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) + (int)_TYPE_ALIGNMENT(((type*)0)->field)) #else # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) #endif diff --git a/dlls/wininet/tests/generated.c b/dlls/wininet/tests/generated.c index dea2d05e9e2..3fd7be41632 100644 --- a/dlls/wininet/tests/generated.c +++ b/dlls/wininet/tests/generated.c @@ -31,22 +31,14 @@ * Windows API extension */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) -# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field) -#elif defined(__GNUC__) -# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field) -#else -/* FIXME: Not sure if is possible to do without compiler extension */ -#endif - #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define _TYPE_ALIGNMENT(type) __alignof(type) #elif defined(__GNUC__) # define _TYPE_ALIGNMENT(type) __alignof__(type) #else /* - * FIXME: Not sure if is possible to do without compiler extension - * (if type is not just a name that is, if so the normal) + * FIXME: May not be possible without a compiler extension + * (if type is not just a name that is, otherwise the normal * TYPE_ALIGNMENT can be used) */ #endif @@ -65,9 +57,9 @@ #ifdef FIELD_ALIGNMENT # define TEST_FIELD_ALIGNMENT(type, field, align) \ - ok(FIELD_ALIGNMENT(type, field) == align, \ + ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \ "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \ - (int)FIELD_ALIGNMENT(type, field)) + (int)_TYPE_ALIGNMENT(((type*)0)->field)) #else # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0) #endif diff --git a/tools/winapi/winapi_test b/tools/winapi/winapi_test index f973928c5e5..36ddfa90515 100755 --- a/tools/winapi/winapi_test +++ b/tools/winapi/winapi_test @@ -512,21 +512,13 @@ sub output_header($$$) { print OUT " */\n"; print OUT "\n"; print OUT "#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n"; - print OUT "# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field)\n"; - print OUT "#elif defined(__GNUC__)\n"; - print OUT "# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)\n"; - print OUT "#else\n"; - print OUT "/* FIXME: Not sure if is possible to do without compiler extension */\n"; - print OUT "#endif\n"; - print OUT "\n"; - print OUT "#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n"; print OUT "# define _TYPE_ALIGNMENT(type) __alignof(type)\n"; print OUT "#elif defined(__GNUC__)\n"; print OUT "# define _TYPE_ALIGNMENT(type) __alignof__(type)\n"; print OUT "#else\n"; print OUT "/*\n"; - print OUT " * FIXME: Not sure if is possible to do without compiler extension\n"; - print OUT " * (if type is not just a name that is, if so the normal)\n"; + print OUT " * FIXME: May not be possible without a compiler extension\n"; + print OUT " * (if type is not just a name that is, otherwise the normal\n"; print OUT " * TYPE_ALIGNMENT can be used)\n"; print OUT " */\n"; print OUT "#endif\n"; @@ -546,9 +538,9 @@ sub output_header($$$) { print OUT "\n"; print OUT "#ifdef FIELD_ALIGNMENT\n"; print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) \\\n"; - print OUT " ok(FIELD_ALIGNMENT(type, field) == align, \\\n"; + print OUT " ok(_TYPE_ALIGNMENT(((type*)0)->field) == align, \\\n"; print OUT " \"FIELD_ALIGNMENT(\" #type \", \" #field \") == %d (expected \" #align \")\\n\", \\\n"; - print OUT " (int)FIELD_ALIGNMENT(type, field))\n"; + print OUT " (int)_TYPE_ALIGNMENT(((type*)0)->field))\n"; print OUT "#else\n"; print OUT "# define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0)\n"; print OUT "#endif\n";