Enable anonymous struct/union support by default in both C and C++.

Disable them for compilers known not to support them.
Disable them for the WINE code.
This commit is contained in:
Francois Gouget 2000-10-12 20:44:41 +00:00 committed by Alexandre Julliard
parent 8930569251
commit 5b317bc556
2 changed files with 14 additions and 7 deletions

View File

@ -54,17 +54,19 @@ extern "C" {
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
#endif /* __WINE__ */
#ifndef NONAMELESSSTRUCT
# if defined(__WINE__) || !defined(_FORCENAMELESSSTRUCT)
#ifdef __WINE__
# define NONAMELESSSTRUCT
# define NONAMELESSUNION
#else
/* Anonymous struct support starts with gcc/g++ 2.96 */
# if !defined(NONAMELESSSTRUCT) && defined(__GNUC__) && ((__GNUC__ < 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ < 96)))
# define NONAMELESSSTRUCT
# endif
#endif /* !defined(NONAMELESSSTRUCT) */
#ifndef NONAMELESSUNION
# if defined(__WINE__) || !defined(_FORCENAMELESSUNION) || !defined(__cplusplus)
/* Anonymous unions support starts with gcc 2.96/g++ 2.95 */
# if !defined(NONAMELESSUNION) && defined(__GNUC__) && ((__GNUC__ < 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ < 95) || ((__GNUC_MINOR__ == 95) && !defined(__cplusplus)))))
# define NONAMELESSUNION
# endif
#endif /* !defined(NONAMELESSUNION) */
#endif
#ifndef NONAMELESSSTRUCT
#define DUMMYSTRUCTNAME

View File

@ -34,8 +34,13 @@
#include "wtypes.h"
#include "guiddef.h"
#ifndef NONAMELESSSTRUCT
#define LISet32(li, v) ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))
#define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))
#else
#define LISet32(li, v) ((li).s.HighPart = (v) < 0 ? -1 : 0, (li).s.LowPart = (v))
#define ULISet32(li, v) ((li).s.HighPart = 0, (li).s.LowPart = (v))
#endif
/*****************************************************************************
* GUID API