Skip to content
Myr

Fix compiling-as-C-pre-C99 issues

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent 38c15ee · Browse files · 2 files+8 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+8 added−3 removed

  • tests:+3 added−0 removed
  • other:+5 added−3 removed

2 files+8 added−3 removed

modified:tests/test_cpp_compilation.cpp+3 added
181 unmodified lines
182 stb_textedit_initialize_state(0,0);183 stb_textedit_paste(0,0,0,0);184}185186#if 0187#define STB_C_LEX_C_DECIMAL_INTS Y // "0|[1-9][0-9]*" CLEX_intlit188#define STB_C_LEX_C_HEX_INTS Y // "0x[0-9a-fA-F]+" CLEX_intlit189#define STB_C_LEX_C_OCTAL_INTS Y // "[0-7]+" CLEX_intlit190#define STB_C_LEX_C_DECIMAL_FLOATS Y // "[0-9]*(.[0-9]*([eE][-+]?[0-9]+)?) CLEX_floatlit
38 unmodified lines
229230//#define STB_C_LEX_ISWHITE(str) ... // return length in bytes of whitespace characters if first char is whitespace231232#define STB_C_LEXER_DEFINITIONS // This line prevents the header file from replacing your definitions233#endif234235#include "stb_c_lexer.h"
modified:stb_truetype.h+5 added-3 removed
2579 unmodified lines
2580 int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2);25812582 stbtt_uint16 class1Count = ttUSHORT(table + 12);2583 stbtt_uint16 class2Count = ttUSHORT(table + 14);2584 stbtt_uint8 *class1Records, *class2Records;2585 stbtt_int16 xAdvance;25862587 if (glyph1class < 0 || glyph1class >= class1Count) return 0; // malformed2588 if (glyph2class < 0 || glyph2class >= class2Count) return 0; // malformed25892588 stbtt_uint8 *class1Records = table + 16;2589 stbtt_uint8 *class2Records = class1Records + 2 * (glyph1class * class2Count);2590 stbtt_int16 xAdvance = ttSHORT(class2Records + 2 * glyph2class);2590 class1Records = table + 16;2591 class2Records = class1Records + 2 * (glyph1class * class2Count);2592 xAdvance = ttSHORT(class2Records + 2 * glyph2class);2593 return xAdvance;2594 } else2595 return 0;2596 break;
2403 unmodified lines