Skip to content

Commit

Permalink
Fixed bug 5139 - move internal structure definition to remove MSVC wa…
Browse files Browse the repository at this point in the history
…rning
  • Loading branch information
1bsyl committed May 15, 2020
1 parent 99f64c8 commit 265d108
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions SDL_ttf.c
Expand Up @@ -189,6 +189,14 @@ typedef struct cached_glyph {
};
} c_glyph;

/* Internal buffer to store positions computed by TTF_Size_Internal()
* for rendered string by Render_Line() */
typedef struct PosBuf {
FT_UInt index;
int x;
int y;
} PosBuf_t;

/* The structure used to hold internal font information */
struct _TTF_Font {
/* Freetype2 maintains all sorts of useful info itself */
Expand Down Expand Up @@ -227,11 +235,7 @@ struct _TTF_Font {

/* Internal buffer to store positions computed by TTF_Size_Internal()
* for rendered string by Render_Line() */
struct PosBuf {
FT_UInt index;
int x;
int y;
} *pos_buf;
PosBuf_t *pos_buf;
Uint32 pos_len;
Uint32 pos_max;

Expand All @@ -243,13 +247,6 @@ struct _TTF_Font {
#endif
};


#ifdef _WIN32
typedef TTF_Font::PosBuf PosBuf_t;
#else
typedef void PosBuf_t;
#endif

/* Tell if SDL_ttf has to handle the style */
#define TTF_HANDLE_STYLE_BOLD(font) ((font)->style & TTF_STYLE_BOLD)
#define TTF_HANDLE_STYLE_ITALIC(font) ((font)->style & TTF_STYLE_ITALIC)
Expand Down

0 comments on commit 265d108

Please sign in to comment.