28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: misc.h,v 1.257 2007/06/15 17:12:31 debug Exp $ |
* $Id: misc.h,v 1.259 2007/06/23 21:04:17 debug Exp $ |
32 |
* |
* |
33 |
* Misc. definitions for gxemul. |
* Misc. definitions for gxemul. |
34 |
*/ |
*/ |
105 |
#endif |
#endif |
106 |
|
|
107 |
|
|
108 |
|
/* tmp dir to use if the TMPDIR environment variable isn't set: */ |
109 |
|
#define DEFAULT_TMP_DIR "/tmp" |
110 |
|
|
111 |
|
|
112 |
struct cpu; |
struct cpu; |
113 |
struct emul; |
struct emul; |
114 |
struct machine; |
struct machine; |
171 |
#define FAILURE(error_msg) { \ |
#define FAILURE(error_msg) { \ |
172 |
char where_msg[400]; \ |
char where_msg[400]; \ |
173 |
snprintf(where_msg, sizeof(where_msg), \ |
snprintf(where_msg, sizeof(where_msg), \ |
174 |
"%s, line %i, function '%s'\n", \ |
"%s, line %i, function %s().\n", \ |
175 |
__FILE__, __LINE__, __FUNCTION__); \ |
__FILE__, __LINE__, __FUNCTION__); \ |
176 |
fprintf(stderr, "%s: %s\n", error_msg, where_msg); \ |
fprintf(stderr, "\n%s, in %s\n", error_msg, where_msg); \ |
177 |
exit(1); \ |
exit(1); \ |
178 |
} |
} |
179 |
|
|
183 |
char where_msg[400]; \ |
char where_msg[400]; \ |
184 |
snprintf(where_msg, sizeof(where_msg), \ |
snprintf(where_msg, sizeof(where_msg), \ |
185 |
"%s, line %i\n", __FILE__, __LINE__); \ |
"%s, line %i\n", __FILE__, __LINE__); \ |
186 |
fprintf(stderr, "%s: %s\n", error_msg, where_msg); \ |
fprintf(stderr, "\n%s, in %s.\n", error_msg, where_msg);\ |
187 |
exit(1); \ |
exit(1); \ |
188 |
} |
} |
189 |
|
|