sovereignx/tools/gbagfx/global.h

36 lines
844 B
C
Raw Normal View History

2015-11-14 05:57:22 +00:00
// Copyright (c) 2015 YamaArashi
#ifndef GLOBAL_H
#define GLOBAL_H
#include <stdio.h>
#include <stdlib.h>
#ifdef _MSC_VER
#define FATAL_ERROR(format, ...) \
do { \
2015-11-14 06:44:23 +00:00
fprintf(stderr, format, __VA_ARGS__); \
exit(1); \
2015-11-14 05:57:22 +00:00
} while (0)
#else
#define FATAL_ERROR(format, ...) \
do { \
2015-11-14 06:44:23 +00:00
fprintf(stderr, format, ##__VA_ARGS__); \
exit(1); \
2015-11-14 05:57:22 +00:00
} while (0)
#endif // _MSC_VER
#define GBAGFX_MAX_PATH 255
#define CHECK_PATH_LENGTH(path) \
do { \
2015-11-14 06:44:23 +00:00
if (strlen(path) > GBAGFX_MAX_PATH) \
FATAL_ERROR("\"%s\" is too long a path.\n", path); \
2015-11-14 05:57:22 +00:00
} while (0)
#endif // GLOBAL_H