From 72e3fc72926b1e39fd7c7f9ae13cabee2d4a23b9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 28 Nov 2016 20:16:27 +0530 Subject: [PATCH] Move ft error handling include into a func --- kitty/freetype.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/kitty/freetype.c b/kitty/freetype.c index f641e4076..c63fe5e95 100644 --- a/kitty/freetype.c +++ b/kitty/freetype.c @@ -9,18 +9,6 @@ #include #include #include FT_FREETYPE_H -#undef FTERRORS_H_ -#define FT_ERRORDEF( e, v, s ) { e, s }, -#define FT_ERROR_START_LIST { -#define FT_ERROR_END_LIST { 0, NULL } }; - -const struct { - int err_code; - const char* err_msg; -} ft_errors[] = - -#include FT_ERRORS_H - typedef struct { PyObject_HEAD @@ -32,6 +20,19 @@ typedef struct { void set_freetype_error(const char* prefix, int err_code) { +#undef FTERRORS_H_ +#define FT_ERRORDEF( e, v, s ) { e, s }, +#define FT_ERROR_START_LIST { +#define FT_ERROR_END_LIST { 0, NULL } }; + + static const struct { + int err_code; + const char* err_msg; + } ft_errors[] = + +#include FT_ERRORS_H + + int i = 0; while(ft_errors[i].err_msg != NULL) { if (ft_errors[i].err_code == err_code) {