diff --git a/include/options.h b/include/options.h index afc1bdaca4e..8e45c2dad3d 100644 --- a/include/options.h +++ b/include/options.h @@ -26,7 +26,7 @@ extern const char *argv0; extern const char *full_argv0; -extern void OPTIONS_Usage(void) WINE_NORETURN; +extern void DECLSPEC_NORETURN OPTIONS_Usage(void); extern void OPTIONS_ParseOptions( char *argv[] ); #endif /* __WINE_OPTIONS_H */ diff --git a/include/thread.h b/include/thread.h index 12b5ff9f8cb..b21406522c8 100644 --- a/include/thread.h +++ b/include/thread.h @@ -145,9 +145,9 @@ extern TEB *THREAD_IdToTEB( DWORD id ); /* scheduler/sysdeps.c */ extern int SYSDEPS_SpawnThread( TEB *teb ); extern void SYSDEPS_SetCurThread( TEB *teb ); -extern void SYSDEPS_ExitThread( int status ) WINE_NORETURN; -extern void SYSDEPS_AbortThread( int status ) WINE_NORETURN; -extern void SYSDEPS_SwitchToThreadStack( void (*func)(void) ) WINE_NORETURN; +extern void DECLSPEC_NORETURN SYSDEPS_ExitThread( int status ); +extern void DECLSPEC_NORETURN SYSDEPS_AbortThread( int status ); +extern void DECLSPEC_NORETURN SYSDEPS_SwitchToThreadStack( void (*func)(void) ); /* signal handling */ extern BOOL SIGNAL_Init(void); diff --git a/include/winbase.h b/include/winbase.h index 95d9782f47d..0aebe0d895d 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1233,8 +1233,8 @@ BOOL WINAPI EnumResourceTypesW(HMODULE,ENUMRESTYPEPROCW,LONG); BOOL WINAPI EqualSid(PSID, PSID); BOOL WINAPI EqualPrefixSid(PSID,PSID); DWORD WINAPI EraseTape(HANDLE,DWORD,BOOL); -VOID WINAPI ExitProcess(DWORD) WINE_NORETURN; -VOID WINAPI ExitThread(DWORD) WINE_NORETURN; +VOID DECLSPEC_NORETURN WINAPI ExitProcess(DWORD); +VOID DECLSPEC_NORETURN WINAPI ExitThread(DWORD); DWORD WINAPI ExpandEnvironmentStringsA(LPCSTR,LPSTR,DWORD); DWORD WINAPI ExpandEnvironmentStringsW(LPCWSTR,LPWSTR,DWORD); #define ExpandEnvironmentStrings WINELIB_NAME_AW(ExpandEnvironmentStrings) diff --git a/include/wine/server.h b/include/wine/server.h index 4a3aec82faa..931f3f7c157 100644 --- a/include/wine/server.h +++ b/include/wine/server.h @@ -110,8 +110,8 @@ inline static void wine_server_set_reply( void *req_ptr, void *ptr, unsigned int /* non-exported functions */ -extern void server_protocol_error( const char *err, ... ) WINE_NORETURN; -extern void server_protocol_perror( const char *err ) WINE_NORETURN; +extern void DECLSPEC_NORETURN server_protocol_error( const char *err, ... ); +extern void DECLSPEC_NORETURN server_protocol_perror( const char *err ); extern void CLIENT_InitServer(void); extern void CLIENT_InitThread(void); extern void CLIENT_BootDone( int debug_level ); diff --git a/include/winnt.h b/include/winnt.h index 5a1cd1a9308..1af018d886c 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -130,11 +130,9 @@ #ifdef __GNUC__ #define WINE_PACKED __attribute__((packed)) #define WINE_UNUSED __attribute__((unused)) -#define WINE_NORETURN __attribute__((noreturn)) #else #define WINE_PACKED /* nothing */ #define WINE_UNUSED /* nothing */ -#define WINE_NORETURN /* nothing */ #endif #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_IA64) || defined(_M_AMD64)) && !defined(MIDL_PASS) @@ -146,6 +144,8 @@ #ifndef DECLSPEC_NORETURN # if (_MSVC_VER >= 1200) && !defined(MIDL_PASS) # define DECLSPEC_NORETURN __declspec(noreturn) +# elif defined(__GNUC__) +# define DECLSPEC_NORETURN __attribute__((noreturn)) # else # define DECLSPEC_NORETURN # endif @@ -153,7 +153,9 @@ #ifndef DECLSPEC_ALIGN # if (_MSC_VER >= 1300) && !defined(MIDL_PASS) -# define DECLSPEC_ALIGN(x) __declspec(align(x)) +# define DECLSPEC_ALIGN(x) __declspec(align(x)) +# elif defined(__GNUC__) +# define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) # else # define DECLSPEC_ALIGN(x) # endif @@ -165,7 +167,7 @@ #ifndef DECLSPEC_UUID # if (_MSC_VER >= 1100) && defined (__cplusplus) -# define DECLSPEC_UUID(x) __declspec(uuid(x)) +# define DECLSPEC_UUID(x) __declspec(uuid(x)) # else # define DECLSPEC_UUID(x) # endif @@ -173,7 +175,7 @@ #ifndef DECLSPEC_NOVTABLE # if (_MSC_VER >= 1100) && defined(__cplusplus) -# define DECLSPEC_NOVTABLE __declspec(novtable) +# define DECLSPEC_NOVTABLE __declspec(novtable) # else # define DECLSPEC_NOVTABLE # endif @@ -181,7 +183,7 @@ #ifndef DECLSPEC_SELECTANY #if (_MSC_VER >= 1100) -#define DECLSPEC_SELECTANY __declspec(selectany) +#define DECLSPEC_SELECTANY __declspec(selectany) #else #define DECLSPEC_SELECTANY #endif @@ -197,7 +199,7 @@ #ifndef DECLSPEC_ADDRSAFE # if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) -# define DECLSPEC_ADDRSAFE __declspec(address_safe) +# define DECLSPEC_ADDRSAFE __declspec(address_safe) # else # define DECLSPEC_ADDRSAFE # endif @@ -206,14 +208,19 @@ #ifndef FORCEINLINE # if (_MSC_VER >= 1200) # define FORCEINLINE __forceinline +# elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))) +# define FORCEINLINE __attribute__((always_inline)) # else -# define FORCEINLINE __inline +# define FORCEINLINE inline # endif #endif #ifndef DECLSPEC_DEPRECATED # if (_MSC_VER >= 1300) && !defined(MIDL_PASS) -# define DECLSPEC_DEPRECATED __declspec(deprecated) +# define DECLSPEC_DEPRECATED __declspec(deprecated) +# define DEPRECATE_SUPPORTED +# elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))) +# define DECLSPEC_DEPRECATED __attribute__((deprecated)) # define DEPRECATE_SUPPORTED # else # define DECLSPEC_DEPRECATED diff --git a/misc/options.c b/misc/options.c index 4479d76cd00..cdade4800e5 100644 --- a/misc/options.c +++ b/misc/options.c @@ -45,7 +45,7 @@ const char *full_argv0; /* the full path of argv[0] (if known) */ static char *inherit_str; /* options to pass to child processes */ -static void out_of_memory(void) WINE_NORETURN; +static void DECLSPEC_NORETURN out_of_memory(void); static void out_of_memory(void) { MESSAGE( "Virtual memory exhausted\n" ); diff --git a/miscemu/main.c b/miscemu/main.c index e21685937a9..f4c722c372d 100644 --- a/miscemu/main.c +++ b/miscemu/main.c @@ -35,8 +35,9 @@ static BOOL (WINAPI *pGetMessageA)(LPMSG,HWND,UINT,UINT); static BOOL (WINAPI *pTranslateMessage)(const MSG*); static LONG (WINAPI *pDispatchMessageA)(const MSG*); -extern void PROCESS_InitWine( int argc, char *argv[], LPSTR win16_exe_name, - HANDLE *win16_exe_file ) WINE_NORETURN; +extern void DECLSPEC_NORETURN PROCESS_InitWine( + int argc, char *argv[], LPSTR win16_exe_name, + HANDLE *win16_exe_file ); extern HINSTANCE16 NE_StartMain( LPCSTR name, HANDLE file ); /*********************************************************************** diff --git a/scheduler/sysdeps.c b/scheduler/sysdeps.c index 5101dd3a568..df3a870bd1d 100644 --- a/scheduler/sysdeps.c +++ b/scheduler/sysdeps.c @@ -233,7 +233,7 @@ int SYSDEPS_SpawnThread( TEB *teb ) /*********************************************************************** * SYSDEPS_CallOnStack */ -void SYSDEPS_CallOnStack( void (*func)(LPVOID), LPVOID arg ) WINE_NORETURN; +void DECLSPEC_NORETURN SYSDEPS_CallOnStack( void (*func)(LPVOID), LPVOID arg ); #ifdef __i386__ #ifdef __GNUC__ __ASM_GLOBAL_FUNC( SYSDEPS_CallOnStack,