Repository: linebender/resvg (language: rust)

Issue:
C API compile error: 'ceil' was not declared in this scope
when I try to compile viewsvg, I encounter an error:

```console
$ cd tools/viewsvg
$ qmake PREFIX="$pkgdir/usr"
$ make
[…]
../../crates/c-api/ResvgQt.h: In member function 'QImage ResvgRenderer::renderToImage(const QSize&) const':
../../crates/c-api/ResvgQt.h:526:36: error: 'ceil' was not declared in this scope; did you mean 'std::chrono::__detail::ceil'?
  526 |             const auto newHeight = ceil(double(size.width()) * sizef.height() / sizef.width());
      |                                    ^~~~
[…]
```


Discussion / hints:

Fix patch:
diff --git a/crates/c-api/ResvgQt.h b/crates/c-api/ResvgQt.h
index f6e49c3d9..33558d027 100644
--- a/crates/c-api/ResvgQt.h
+++ b/crates/c-api/ResvgQt.h
@@ -18,6 +18,8 @@
 #define RESVG_QT_PATCH_VERSION 1
 #define RESVG_QT_VERSION "0.34.1"
 
+#include <cmath>
+
 #include <QDebug>
 #include <QFile>
 #include <QFileInfo>
@@ -523,7 +525,7 @@ class ResvgRenderer {
         if (size.isValid()) {
             // TODO: support height too.
             auto sizef = defaultSizeF();
-            const auto newHeight = ceil(double(size.width()) * sizef.height() / sizef.width());
+            const auto newHeight = std::ceil(double(size.width()) * sizef.height() / sizef.width());
             ts.a = double(size.width()) / sizef.width();
             ts.d = newHeight / defaultSizeF().width();
         }


Test patch: