summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/msvc.h
diff options
context:
space:
mode:
authorAlexander Vostres <alexx999@gmail.com>2011-07-16 08:24:09 +0300
committerAdam Borowski <kilobyte@angband.pl>2011-07-17 00:34:44 +0200
commit0197981c162e6d68264d56af1b029abebfa22e6a (patch)
tree28b28161f8610df41238b3be289708627a2d2100 /crawl-ref/source/msvc.h
parent6de05d6d8271e6b4a4eac11b8b10d45dcb1c7794 (diff)
downloadcrawl-ref-0197981c162e6d68264d56af1b029abebfa22e6a.tar.gz
crawl-ref-0197981c162e6d68264d56af1b029abebfa22e6a.zip
Partial fix for broken MSVC build (still need to fix prebuild)
The MSVC2010/ dir is omitted, since it doesn't work for me yet, and adding a whole yet useless dir just before branching would be counterproductive. -- 1KB
Diffstat (limited to 'crawl-ref/source/msvc.h')
-rw-r--r--crawl-ref/source/msvc.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/crawl-ref/source/msvc.h b/crawl-ref/source/msvc.h
index 12f7bec904..96f87000e0 100644
--- a/crawl-ref/source/msvc.h
+++ b/crawl-ref/source/msvc.h
@@ -45,6 +45,9 @@
// truncating conversions XXX: fix these too!
#pragma warning(disable : 4244)
+// POSIX deprecation warnings
+#pragma warning(disable : 4996)
+
inline double round(double x)
{
@@ -54,6 +57,37 @@ inline double round(double x)
return ceil(x - 0.5);
}
+inline double sqrt(int x)
+{
+ return sqrt((double)x);
+}
+
+inline double atan2(int x, int y)
+{
+ return atan2((double)x, (double)y);
+}
+
+inline double pow(int x, double y)
+{
+ return pow((double)x, y);
+}
+
+inline double pow(int x, int y)
+{
+ return pow((double)x, y);
+}
+
+inline double log(int x)
+{
+ return log((double)x);
+}
+
+//this is targeting for struct member name in store.h, nothing else gets affected as of 0.9.0
+#define _int64 var_int64
+
+//missing in sys/types.h
+#define mode_t unsigned short
+
typedef ptrdiff_t ssize_t;
#endif /* defined(TARGET_COMPILER_VC) */