2006-03-20 16:43:15 +00:00
|
|
|
/*
|
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
2013-02-24 02:39:48 +00:00
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
2006-03-20 16:43:15 +00:00
|
|
|
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
2008-01-23 17:25:09 +00:00
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Header for error handling/printing/exiting code
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2008-01-23 17:25:09 +00:00
|
|
|
#ifndef _ERROR_H
|
|
|
|
#define _ERROR_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2013-06-27 02:35:22 +00:00
|
|
|
#include "dxxsconf.h"
|
2013-06-23 02:28:43 +00:00
|
|
|
#include <assert.h>
|
2008-01-23 17:25:09 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define __noreturn __attribute__ ((noreturn))
|
|
|
|
#else
|
|
|
|
#define __noreturn
|
|
|
|
#endif
|
|
|
|
|
2013-06-08 22:24:17 +00:00
|
|
|
void warn_printf(const char *s);
|
2013-06-23 21:18:48 +00:00
|
|
|
int error_init(void (*func)(const char *)); //init error system, returns 0=ok
|
2013-06-27 02:35:22 +00:00
|
|
|
void Warning(const char *fmt,...) __attribute_format_printf(1, 2); //print out warning message to user
|
2013-06-08 22:24:17 +00:00
|
|
|
void set_warn_func(void (*f)(const char *s));//specifies the function to call with warning messages
|
2013-06-08 23:12:44 +00:00
|
|
|
void clear_warn_func();//say this function no longer valid
|
2012-07-07 18:37:55 +00:00
|
|
|
void Error(const char *func, unsigned line, const char *fmt,...) __noreturn __attribute_format_printf(3, 4); //exit with error code=1, print message
|
|
|
|
#define Error(F,...) ((Error)(__func__, __LINE__, (F), ## __VA_ARGS__))
|
2013-06-23 02:28:43 +00:00
|
|
|
#define Assert assert
|
2006-03-20 16:43:15 +00:00
|
|
|
#ifndef NDEBUG //macros for debugging
|
|
|
|
|
2008-01-03 10:31:02 +00:00
|
|
|
# if defined(__APPLE__) || defined(macintosh)
|
|
|
|
extern void Debugger(void); // Avoids some name clashes
|
|
|
|
# define Int3 Debugger
|
|
|
|
# else
|
|
|
|
# define Int3() ((void)0)
|
|
|
|
# endif // Macintosh
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
#else //macros for real game
|
|
|
|
|
|
|
|
//Changed Assert and Int3 because I couldn't get the macros to compile -KRB
|
|
|
|
#define Int3() ((void)0)
|
|
|
|
#endif
|
2008-01-23 17:25:09 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-01-23 17:25:09 +00:00
|
|
|
#endif /* _ERROR_H */
|