aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/dri-vmwgfx/vmw_powf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/targets/dri-vmwgfx/vmw_powf.c')
-rw-r--r--src/gallium/targets/dri-vmwgfx/vmw_powf.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/targets/dri-vmwgfx/vmw_powf.c b/src/gallium/targets/dri-vmwgfx/vmw_powf.c
new file mode 100644
index 00000000000..ca5e39b389a
--- /dev/null
+++ b/src/gallium/targets/dri-vmwgfx/vmw_powf.c
@@ -0,0 +1,17 @@
+/**
+ * Powf may leave an unresolved symbol pointing to a libstdc++.so powf.
+ * However, not all libstdc++.so include this function, so optionally
+ * replace the powf function with calls to expf and logf.
+ */
+
+#ifdef VMW_RESOLVE_POWF
+
+extern float expf(float x);
+extern float logf(float x);
+extern float powf(float x, float y);
+
+float powf(float x, float y) {
+ return expf(logf(x)*y);
+}
+
+#endif