- Forte C does not support nameless structures or unions

- Implemented __builtin_return_address for Forte C on sparc
- Implemented DECL_GLOBAL_CONSTRUCTOR for non-386, non-GNU C
- Implemented WINE_DPRINTF to have function name with Forte C
This commit is contained in:
Gregg Mattinson 2002-07-05 21:22:09 +00:00 committed by Alexandre Julliard
parent c1f3738568
commit 81cbb28d07
4 changed files with 45 additions and 6 deletions

View File

@ -77,6 +77,10 @@
/* Internal definitions (do not use these directly) */
#ifdef __SUNPRO_C
#define __FUNCTION__ __func__
#endif
enum __DEBUG_CLASS { __DBCL_FIXME, __DBCL_ERR, __DBCL_WARN, __DBCL_TRACE, __DBCL_COUNT };
extern char __debug_msg_enabled[__DBCL_COUNT];

View File

@ -76,7 +76,20 @@ enum __WINE_DEBUG_CLASS {
#define __WINE_PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
#else /* __GNUC__ */
#elif defined(__SUNPRO_C)
#define __WINE_DPRINTF(dbcl,dbch) \
do { if(__WINE_GET_DEBUGGING(dbcl,(dbch))) { \
const char * const __dbch = (dbch); \
const enum __WINE_DEBUG_CLASS __dbcl = __WINE_DBCL##dbcl; \
__WINE_DBG_LOG
#define __WINE_DBG_LOG(...) \
wine_dbg_log( __dbcl, __dbch, __func__, __VA_ARGS__); } } while(0)
#define __WINE_PRINTF_ATTR(fmt,args)
#else /* !__GNUC__ && !__SUNPRO_C */
#define __WINE_DPRINTF(dbcl,dbch) \
(!__WINE_GET_DEBUGGING(dbcl,(dbch)) || \
@ -85,7 +98,7 @@ enum __WINE_DEBUG_CLASS {
#define __WINE_PRINTF_ATTR(fmt, args)
#endif /* __GNUC__ */
#endif /* !__GNUC__ && !__SUNPRO_C */
/*

View File

@ -152,11 +152,11 @@
# define NONAMELESSUNION
#else
/* Anonymous struct support starts with gcc/g++ 2.96 */
# if !defined(NONAMELESSSTRUCT) && defined(__GNUC__) && ((__GNUC__ < 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ < 96)))
# if !defined(NONAMELESSSTRUCT) && (defined(__GNUC__) && ((__GNUC__ < 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ < 96)))) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# define NONAMELESSSTRUCT
# endif
/* 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)))))
# if !defined(NONAMELESSUNION) && (defined(__GNUC__) && ((__GNUC__ < 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ < 95) || ((__GNUC_MINOR__ == 95) && !defined(__cplusplus)))))) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# define NONAMELESSUNION
# endif
#endif
@ -1137,6 +1137,18 @@ typedef CONTEXT *PCONTEXT;
#endif /* __i386__ */
#ifdef __sparc__
#ifdef __SUNPRO_C
static DWORD __builtin_return_address(int p_iDepth)
{
asm("ta 3");
asm("mov %fp, %l0");
while (p_iDepth--)
asm("ld [%l0+56], %l0");
asm("ld [%l0+60], %i0");
}
#endif
/* FIXME: use getcontext() to retrieve full context */
#define _GET_CONTEXT \
CONTEXT context; \
@ -1210,8 +1222,18 @@ typedef CONTEXT *PCONTEXT;
".previous"); } \
static void func(void)
# else /* __i386__ */
# ifdef __sparc__
# define DECL_GLOBAL_CONSTRUCTOR(func) \
static void __dummy_init_##func(void) { \
asm("\t.section \".init\",#alloc,#execinstr\n" \
"\tcall " #func "\n" \
"\tnop\n" \
"\t.section \".text\",#alloc,#execinstr\n" ); } \
static void func(void)
# else
# error You must define the DECL_GLOBAL_CONSTRUCTOR macro for your platform
# endif
# endif
#endif /* __GNUC__ */
#endif /* __WINE__ */

View File

@ -215,7 +215,7 @@ void WINAPI INT_Int2fHandler( CONTEXT86 *context )
}
break;
case 0xb7: /* append */
LOBYTE(context->Eax) = 0; /* not installed */
AL_reg(context) = 0; /* not installed */
break;
case 0xb8: /* network */
switch (LOBYTE(context->Eax))