summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/AppHdr.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-05-05 22:04:52 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-05-05 22:05:29 +0200
commitddab1927f6fa23495dc23af7860f2e0d01010978 (patch)
tree8fc5d268f55e09cf4a232a67205fa1762eea5cf0 /crawl-ref/source/AppHdr.h
parent3495f4ab936ad025bd2d9c4ab14c9a0119653322 (diff)
downloadcrawl-ref-ddab1927f6fa23495dc23af7860f2e0d01010978.tar.gz
crawl-ref-ddab1927f6fa23495dc23af7860f2e0d01010978.zip
Port to OpenSolaris (Dyson/Illumos).
This might be portability for portability sake (Solaris is so dead), but come on, we can't disappoint Igor Pashev by porting our stuff later than several hours after the first installable build of Dyson is released :)
Diffstat (limited to 'crawl-ref/source/AppHdr.h')
-rw-r--r--crawl-ref/source/AppHdr.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index af6914b14a..5cb5a21d72 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -41,6 +41,16 @@ static inline T move(T x) { return x; } // good enough for our purposes
#define NOMINMAX
#endif
+#ifdef __sun
+// Solaris libc has ambiguous overloads for float, double, long float, so
+// we need to upgrade ints explicitely:
+#include <math.h>
+static inline double sqrt(int x) { return sqrt((double)x); }
+static inline double atan2(int x, int y) { return atan2((double)x, (double)y); }
+static inline double pow(int x, int y) { return std::pow((double)x, y); }
+static inline double pow(int x, double y) { return std::pow((double)x, y); }
+#endif
+
// The maximum memory that the user-script Lua interpreter can
// allocate, in kilobytes. This limit is enforced to prevent
// badly-written or malicious user scripts from consuming too much