noreturn functions: use the 'aborts' aux pragma with Watcom

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1447 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2017-07-28 20:11:03 +00:00
parent 386cb1a720
commit b99a823965
4 changed files with 18 additions and 3 deletions

View file

@ -130,6 +130,9 @@ extern int pr_xstatement;
extern unsigned short pr_crc;
#ifdef __WATCOMC__
#pragma aux PR_RunError aborts;
#endif
FUNC_NORETURN void PR_RunError (const char *error, ...) FUNC_PRINTF(1,2);
void ED_PrintEdicts (void);

View file

@ -184,6 +184,8 @@ typedef int ssize_t;
/*==========================================================================*/
/* function attributes, etc */
#if defined(__GNUC__)
#define FUNC_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
#else
@ -208,6 +210,8 @@ typedef int ssize_t;
#define FUNC_NORETURN __attribute__((__noreturn__))
#elif defined(_MSC_VER) && (_MSC_VER >= 1200)
#define FUNC_NORETURN __declspec(noreturn)
#elif defined(__WATCOMC__)
#define FUNC_NORETURN /* use the 'aborts' aux pragma */
#else
#define FUNC_NORETURN
#endif

View file

@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __QUAKEDEFS_H
#define __QUAKEDEFS_H
#ifndef QUAKEDEFS_H
#define QUAKEDEFS_H
// quakedef.h -- primary header for client
@ -305,6 +305,10 @@ void Host_Shutdown(void);
void Host_Callback_Notify (cvar_t *var); /* callback function for CVAR_NOTIFY */
FUNC_NORETURN void Host_Error (const char *error, ...) FUNC_PRINTF(1,2);
FUNC_NORETURN void Host_EndGame (const char *message, ...) FUNC_PRINTF(1,2);
#ifdef __WATCOMC__
#pragma aux Host_Error aborts;
#pragma aux Host_EndGame aborts;
#endif
void Host_Frame (float time);
void Host_Quit_f (void);
void Host_ClientCommands (const char *fmt, ...) FUNC_PRINTF(1,2);
@ -325,5 +329,5 @@ extern qboolean isDedicated;
extern int minimum_memory;
#endif /* __QUAKEDEFS_H */
#endif /* QUAKEDEFS_H */

View file

@ -48,6 +48,10 @@ void Sys_mkdir (const char *path);
FUNC_NORETURN void Sys_Quit (void);
FUNC_NORETURN void Sys_Error (const char *error, ...) FUNC_PRINTF(1,2);
// an error will cause the entire program to exit
#ifdef __WATCOMC__
#pragma aux Sys_Error aborts;
#pragma aux Sys_Quit aborts;
#endif
void Sys_Printf (const char *fmt, ...) FUNC_PRINTF(1,2);
// send text to the console