diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-12-14 15:39:04 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-12-14 11:29:55 +0000 |
commit | 8cde2e6655ba353596a0312c7ad115d6807fc42d (patch) | |
tree | 92146e53f9e6126bc904e2ca36948f1a6cee4254 /recipes | |
parent | 91d46b0759aaf594ebe0da86090b1c394706a614 (diff) |
graphene.recipe: Fix build error on 32-bit MSVC
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/graphene.recipe | 4 | ||||
-rw-r--r-- | recipes/graphene/0001-bench-Fix-MSVC-build-error-on-32-bit-Windows.patch | 44 |
2 files changed, 47 insertions, 1 deletions
diff --git a/recipes/graphene.recipe b/recipes/graphene.recipe index 3f638f2f..58e94b95 100644 --- a/recipes/graphene.recipe +++ b/recipes/graphene.recipe @@ -34,7 +34,9 @@ class Recipe(recipe.Recipe): # https://github.com/ebassi/graphene/pull/127 patches = ['graphene/0001-meson-fix-HAVE_INIT_ONCE-declaration.patch', # https://github.com/ebassi/graphene/pull/128 - 'graphene/0001-Fix-implicit-conversion-error-when-compiling-with-MS.patch'] + 'graphene/0001-Fix-implicit-conversion-error-when-compiling-with-MS.patch', + # https://github.com/ebassi/graphene/pull/130 + 'graphene/0001-bench-Fix-MSVC-build-error-on-32-bit-Windows.patch'] deps = ['glib'] diff --git a/recipes/graphene/0001-bench-Fix-MSVC-build-error-on-32-bit-Windows.patch b/recipes/graphene/0001-bench-Fix-MSVC-build-error-on-32-bit-Windows.patch new file mode 100644 index 00000000..0deccd62 --- /dev/null +++ b/recipes/graphene/0001-bench-Fix-MSVC-build-error-on-32-bit-Windows.patch @@ -0,0 +1,44 @@ +From 28800bbc05a63905e5ae47274ca67e779c4f6524 Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan <nirbheek@centricular.com> +Date: Fri, 14 Dec 2018 15:30:47 +0530 +Subject: [PATCH] bench: Fix MSVC build error on 32-bit Windows + +size_t is `unsigned long int` which is a 32-bit integer on 32-bit +Windows. The multiplication in malloc() then evaluates to a 32-bit +integer which the compiler complains about. + +This is normally a warning, but since we use `-we4244` it's an error. + +src/bench/graphene-bench-utils.c(175): error C4244: 'function': conversion from 'gint64' to 'size_t', possible loss of data` + +The number of rounds will never exceed INT_MAX, so we can just use an +int here. +--- + src/bench/graphene-bench-utils.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/bench/graphene-bench-utils.c b/src/bench/graphene-bench-utils.c +index 1b6add0..ac294a9 100644 +--- a/src/bench/graphene-bench-utils.c ++++ b/src/bench/graphene-bench-utils.c +@@ -166,7 +166,7 @@ static double + graphene_bench_run_test (const char *impl, + const char *path, + GrapheneBenchFunc func, +- gint64 num_rounds, ++ int num_rounds, + double *round_min, + double *round_max, + double *round_avg) +@@ -224,7 +224,7 @@ graphene_bench_run_test (const char *impl, + free (round_elapsed); + + if (bench_verbose) +- g_printerr ("# '[%s]:%s': %.6f usecs/round after %" G_GINT64_FORMAT " rounds\n", ++ g_printerr ("# '[%s]:%s': %.6f usecs/round after %i rounds\n", + impl, + path, + elapsed, +-- +2.19.1 + |