Commit 45be0195 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

include: Added macros for unions and structs that should remain nameless…

include: Added macros for unions and structs that should remain nameless regardless NONAMELESSUNION/NONAMELESSSTRUCT definition.
parent fea5767a
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
DLLFLAGS = @DLLFLAGS@ DLLFLAGS = @DLLFLAGS@
DEFS = -DWINE_STRICT_PROTOTYPES $(EXTRADEFS) DEFS = -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION $(EXTRADEFS)
MODULE = $(TESTDLL:%.dll=%)_test.exe MODULE = $(TESTDLL:%.dll=%)_test.exe
TESTRESULTS = $(C_SRCS:.c=.ok) TESTRESULTS = $(C_SRCS:.c=.ok)
......
...@@ -46,15 +46,15 @@ typedef struct _INTERNET_CACHE_CONFIG_INFOA ...@@ -46,15 +46,15 @@ typedef struct _INTERNET_CACHE_CONFIG_INFOA
BOOL fPerUser; BOOL fPerUser;
DWORD dwSyncMode; DWORD dwSyncMode;
DWORD dwNumCachePaths; DWORD dwNumCachePaths;
union __C89_NAMELESSUNION union
{ {
struct __C89_NAMELESSSTRUCT struct
{ {
CHAR CachePath[MAX_PATH]; CHAR CachePath[MAX_PATH];
DWORD dwCacheSize; DWORD dwCacheSize;
} DUMMYSTRUCTNAME; } __C89_NAMELESSSTRUCTNAME;
INTERNET_CACHE_CONFIG_PATH_ENTRYA CachePaths[ANYSIZE_ARRAY]; INTERNET_CACHE_CONFIG_PATH_ENTRYA CachePaths[ANYSIZE_ARRAY];
} DUMYUNIONNAME; } __C89_NAMELESSUNIONNAME;
DWORD dwNormalUsage; DWORD dwNormalUsage;
DWORD dwExemptUsage; DWORD dwExemptUsage;
} INTERNET_CACHE_CONFIG_INFOA, *LPINTERNET_CACHE_CONFIG_INFOA; } INTERNET_CACHE_CONFIG_INFOA, *LPINTERNET_CACHE_CONFIG_INFOA;
...@@ -68,15 +68,15 @@ typedef struct _INTERNET_CACHE_CONFIG_INFOW ...@@ -68,15 +68,15 @@ typedef struct _INTERNET_CACHE_CONFIG_INFOW
BOOL fPerUser; BOOL fPerUser;
DWORD dwSyncMode; DWORD dwSyncMode;
DWORD dwNumCachePaths; DWORD dwNumCachePaths;
union __C89_NAMELESSUNION union
{ {
struct __C89_NAMELESSSTRUCT struct
{ {
WCHAR CachePath[MAX_PATH]; WCHAR CachePath[MAX_PATH];
DWORD dwCacheSize; DWORD dwCacheSize;
} DUMMYSTRUCTNAME; } __C89_NAMELESSSTRUCTNAME;
INTERNET_CACHE_CONFIG_PATH_ENTRYW CachePaths[ANYSIZE_ARRAY]; INTERNET_CACHE_CONFIG_PATH_ENTRYW CachePaths[ANYSIZE_ARRAY];
} ; } __C89_NAMELESSUNIONNAME;
DWORD dwNormalUsage; DWORD dwNormalUsage;
DWORD dwExemptUsage; DWORD dwExemptUsage;
} INTERNET_CACHE_CONFIG_INFOW, *LPINTERNET_CACHE_CONFIG_INFOW; } INTERNET_CACHE_CONFIG_INFOW, *LPINTERNET_CACHE_CONFIG_INFOW;
......
...@@ -230,6 +230,44 @@ extern "C" { ...@@ -230,6 +230,44 @@ extern "C" {
#define DUMMYUNIONNAME8 u8 #define DUMMYUNIONNAME8 u8
#endif /* !defined(NONAMELESSUNION) */ #endif /* !defined(NONAMELESSUNION) */
#ifndef __C89_NAMELESSSTRUCT
# if !defined(__WINESRC__) && !defined(WINE_NO_NAMELESS_EXTENSION)
# ifdef __GNUC__
/* Anonymous structs support starts with gcc 2.96/g++ 2.95 */
# if (__GNUC__ > 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ > 95) || ((__GNUC_MINOR__ == 95) && defined(__cplusplus))))
# define __C89_NAMELESSSTRUCT __extension__
# endif
# elif defined(_MSC_VER)
# define __C89_NAMELESSSTRUCT
# endif
# endif
# ifdef __C89_NAMELESSSTRUCT
# define __C89_NAMELESSSTRUCTNAME
# else
# define __C89_NAMELESSSTRUCT
# define __C89_NAMELESSSTRUCTNAME DUMMYSTRUCTNAME
# endif
#endif
#ifndef __C89_NAMELESSUNION
# if !defined(__WINESRC__) && !defined(WINE_NO_NAMELESS_EXTENSION)
# ifdef __GNUC__
/* Anonymous unions support starts with gcc 2.96/g++ 2.95 */
# if (__GNUC__ > 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ > 95) || ((__GNUC_MINOR__ == 95) && defined(__cplusplus))))
# define __C89_NAMELESSUNION __extension__
# endif
# elif defined(_MSC_VER)
# define __C89_NAMELESSUNION
# endif
# endif
# ifdef __C89_NAMELESSUNION
# define __C89_NAMELESSUNIONNAME
# else
# define __C89_NAMELESSUNION
# define __C89_NAMELESSUNIONNAME DUMMYUNIONNAME
# endif
#endif
/* C99 restrict support */ /* C99 restrict support */
#if defined(ENABLE_RESTRICTED) && !defined(MIDL_PASS) && !defined(RC_INVOKED) #if defined(ENABLE_RESTRICTED) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment