Skip to content
This repository was archived by the owner on Mar 21, 2021. It is now read-only.

Commit 2a6f04c

Browse files
committed
Fixed bug 5139 - move internal structure definition to remove MSVC warning
1 parent 61f533b commit 2a6f04c

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

SDL_ttf.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ typedef struct cached_glyph {
189189
};
190190
} c_glyph;
191191

192+
/* Internal buffer to store positions computed by TTF_Size_Internal()
193+
* for rendered string by Render_Line() */
194+
typedef struct PosBuf {
195+
FT_UInt index;
196+
int x;
197+
int y;
198+
} PosBuf_t;
199+
192200
/* The structure used to hold internal font information */
193201
struct _TTF_Font {
194202
/* Freetype2 maintains all sorts of useful info itself */
@@ -227,11 +235,7 @@ struct _TTF_Font {
227235

228236
/* Internal buffer to store positions computed by TTF_Size_Internal()
229237
* for rendered string by Render_Line() */
230-
struct PosBuf {
231-
FT_UInt index;
232-
int x;
233-
int y;
234-
} *pos_buf;
238+
PosBuf_t *pos_buf;
235239
Uint32 pos_len;
236240
Uint32 pos_max;
237241

@@ -243,13 +247,6 @@ struct _TTF_Font {
243247
#endif
244248
};
245249

246-
247-
#ifdef _WIN32
248-
typedef TTF_Font::PosBuf PosBuf_t;
249-
#else
250-
typedef void PosBuf_t;
251-
#endif
252-
253250
/* Tell if SDL_ttf has to handle the style */
254251
#define TTF_HANDLE_STYLE_BOLD(font) ((font)->style & TTF_STYLE_BOLD)
255252
#define TTF_HANDLE_STYLE_ITALIC(font) ((font)->style & TTF_STYLE_ITALIC)

0 commit comments

Comments
 (0)