Skip to content

Commit

Permalink
freetypecheck: Use strverscmp instead of strcmp
Browse files Browse the repository at this point in the history
Fixes Freetype check fails openjdk-mirror#6

strcmp fails with lexicographical comp
  • Loading branch information
Prasanth-rp committed Jul 8, 2024
1 parent f4d8095 commit eb3b7d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions make/tools/freetypecheck/freetypecheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int main(int argc, char** argv) {
QUOTEMACRO(REQUIRED_FREETYPE_VERSION));

printf("Detected freetype headers: %s\n", v);
if (strcmp(v, QUOTEMACRO(REQUIRED_FREETYPE_VERSION)) < 0) {
if (strverscmp(v, QUOTEMACRO(REQUIRED_FREETYPE_VERSION)) < 0) {
printf("Failed: headers are too old.\n");
}

Expand All @@ -93,7 +93,7 @@ int main(int argc, char** argv) {
sprintf(v, "%d.%d.%d", major, minor, patch);

printf("Detected freetype library: %s\n", v);
if (strcmp(v, QUOTEMACRO(REQUIRED_FREETYPE_VERSION)) < 0) {
if (strverscmp(v, QUOTEMACRO(REQUIRED_FREETYPE_VERSION)) < 0) {
printf("Failed: too old library.\n");
}

Expand Down

0 comments on commit eb3b7d9

Please sign in to comment.