New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix arm-none-eabi build (fixes #451) #496
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ endif () | |
|
||
## Detect if we are running inside a distribution or regular repository folder | ||
set(IN_HB_DIST FALSE) | ||
if (EXISTS "${PROJECT_SOURCE_DIR}/src/hb-version.h") | ||
if (EXISTS "${PROJECT_SOURCE_DIR}/ChangeLog") | ||
# perhaps we are on dist directory | ||
set(IN_HB_DIST TRUE) | ||
set(HB_VERSION_H "${PROJECT_SOURCE_DIR}/src/hb-version.h") | ||
|
@@ -128,7 +128,7 @@ set(HB_VERSION_MICRO ${CMAKE_MATCH_4}) | |
|
||
## Define ragel tasks | ||
if (NOT IN_HB_DIST) | ||
find_program(RAGEL "ragel") | ||
find_program(RAGEL "ragel" CMAKE_FIND_ROOT_PATH_BOTH) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So it can find ragel on vitasdk environment. |
||
|
||
if (RAGEL) | ||
message(STATUS "ragel found at: ${RAGEL}") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -670,6 +670,30 @@ parse_uint (const char **pp, const char *end, unsigned int *pv) | |
return true; | ||
} | ||
|
||
static bool | ||
parse_uint32 (const char **pp, const char *end, uint32_t *pv) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplication of parse_uint, no template please as it opens another can of worms on different platforms I'd think :) |
||
{ | ||
char buf[32]; | ||
unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp)); | ||
strncpy (buf, *pp, len); | ||
buf[len] = '\0'; | ||
|
||
char *p = buf; | ||
char *pend = p; | ||
unsigned int v; | ||
|
||
/* Intentionally use strtol instead of strtoul, such that | ||
* -1 turns into "big number"... */ | ||
errno = 0; | ||
v = strtol (p, &pend, 0); | ||
if (errno || p == pend) | ||
return false; | ||
|
||
*pv = v; | ||
*pp += pend - p; | ||
return true; | ||
} | ||
|
||
static bool | ||
parse_float (const char **pp, const char *end, float *pv) | ||
{ | ||
|
@@ -693,7 +717,7 @@ parse_float (const char **pp, const char *end, float *pv) | |
} | ||
|
||
static bool | ||
parse_bool (const char **pp, const char *end, unsigned int *pv) | ||
parse_bool (const char **pp, const char *end, uint32_t *pv) | ||
{ | ||
parse_space (pp, end); | ||
|
||
|
@@ -792,7 +816,7 @@ static bool | |
parse_feature_value_postfix (const char **pp, const char *end, hb_feature_t *feature) | ||
{ | ||
bool had_equal = parse_char (pp, end, '='); | ||
bool had_value = parse_uint (pp, end, &feature->value) || | ||
bool had_value = parse_uint32 (pp, end, &feature->value) || | ||
parse_bool (pp, end, &feature->value); | ||
/* CSS doesn't use equal-sign between tag and value. | ||
* If there was an equal-sign, then there *must* be a value. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,7 @@ struct hb_ot_face_metrics_accelerator_t | |
return this->default_advance; | ||
} | ||
|
||
return this->table->longMetric[MIN (glyph, this->num_advances - 1)].advance | ||
return this->table->longMetric[MIN (glyph, (uint32_t) this->num_advances - 1)].advance | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As requested instead interfering with "num_advances" type |
||
+ this->var->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?! | ||
} | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -279,7 +279,7 @@ hb_ot_layout_get_ligature_carets (hb_font_t *font, | |
hb_codepoint_t glyph, | ||
unsigned int start_offset, | ||
unsigned int *caret_count /* IN/OUT */, | ||
int *caret_array /* OUT */) | ||
hb_position_t *caret_array /* OUT */) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now it matches with its actual signature on src/hb-ot-layout.h |
||
{ | ||
return _get_gdef (font->face).get_lig_carets (font, direction, glyph, start_offset, caret_count, caret_array); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,28 +139,28 @@ joining_type (hb_codepoint_t u) | |
switch (u >> 12) | ||
{ | ||
case 0x0u: | ||
if (hb_in_range (u, 0x0600u, 0x08E2u)) return joining_table[u - 0x0600u + joining_offset_0x0600u]; | ||
if (hb_in_range<hb_codepoint_t> (u, 0x0600u, 0x08E2u)) return joining_table[u - 0x0600u + joining_offset_0x0600u]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I change 0x0600u to 0x0600uL it works on arm-none-eabi but not on my default build system, so best way here would be disambiguating it I'd guess. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another option would be to define a macro U:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was doing this but found out U already has a conflicting use. Not in favor of u() personally as it will obfuscating things more on my view, lets defer it if is possible. Template disambiguating had before use on the project so they are not that unusual I'd guess |
||
break; | ||
|
||
case 0x1u: | ||
if (hb_in_range (u, 0x1806u, 0x18AAu)) return joining_table[u - 0x1806u + joining_offset_0x1806u]; | ||
if (hb_in_range<hb_codepoint_t> (u, 0x1806u, 0x18AAu)) return joining_table[u - 0x1806u + joining_offset_0x1806u]; | ||
break; | ||
|
||
case 0x2u: | ||
if (hb_in_range (u, 0x200Cu, 0x2069u)) return joining_table[u - 0x200Cu + joining_offset_0x200cu]; | ||
if (hb_in_range<hb_codepoint_t> (u, 0x200Cu, 0x2069u)) return joining_table[u - 0x200Cu + joining_offset_0x200cu]; | ||
break; | ||
|
||
case 0xAu: | ||
if (hb_in_range (u, 0xA840u, 0xA873u)) return joining_table[u - 0xA840u + joining_offset_0xa840u]; | ||
if (hb_in_range<hb_codepoint_t> (u, 0xA840u, 0xA873u)) return joining_table[u - 0xA840u + joining_offset_0xa840u]; | ||
break; | ||
|
||
case 0x10u: | ||
if (hb_in_range (u, 0x10AC0u, 0x10AEFu)) return joining_table[u - 0x10AC0u + joining_offset_0x10ac0u]; | ||
if (hb_in_range (u, 0x10B80u, 0x10BAFu)) return joining_table[u - 0x10B80u + joining_offset_0x10b80u]; | ||
if (hb_in_range<hb_codepoint_t> (u, 0x10AC0u, 0x10AEFu)) return joining_table[u - 0x10AC0u + joining_offset_0x10ac0u]; | ||
if (hb_in_range<hb_codepoint_t> (u, 0x10B80u, 0x10BAFu)) return joining_table[u - 0x10B80u + joining_offset_0x10b80u]; | ||
break; | ||
|
||
case 0x1Eu: | ||
if (hb_in_range (u, 0x1E900u, 0x1E943u)) return joining_table[u - 0x1E900u + joining_offset_0x1e900u]; | ||
if (hb_in_range<hb_codepoint_t> (u, 0x1E900u, 0x1E943u)) return joining_table[u - 0x1E900u + joining_offset_0x1e900u]; | ||
break; | ||
|
||
default: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better is-in-distribution check