summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/msvc.h
diff options
context:
space:
mode:
authorPete Hurst <pete@streamuniverse.tv>2013-05-15 06:17:20 +0100
committerPete Hurst <pete@streamuniverse.tv>2013-05-19 23:01:05 +0100
commit92cb0aeb7f28ae7c86213d7b1c6800fb4326cd52 (patch)
tree6c3847e32937156b68dbf0e2bfd5fef1da35d8d2 /crawl-ref/source/msvc.h
parentb0b74b27d9c21a209aad7aa89a4cfd9c4ab02de5 (diff)
downloadcrawl-ref-92cb0aeb7f28ae7c86213d7b1c6800fb4326cd52.tar.gz
crawl-ref-92cb0aeb7f28ae7c86213d7b1c6800fb4326cd52.zip
Fix some missing functions for MSVC (xFleury)
log2 is missing from math.h strcasecmp was incorrectly macro'd to _stricmp
Diffstat (limited to 'crawl-ref/source/msvc.h')
-rw-r--r--crawl-ref/source/msvc.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/msvc.h b/crawl-ref/source/msvc.h
index 7ac863399b..9e2f3989bb 100644
--- a/crawl-ref/source/msvc.h
+++ b/crawl-ref/source/msvc.h
@@ -17,9 +17,8 @@
#define fileno _fileno
#define snprintf _snprintf
-#define strcasecmp _strcasecmp
#define strdup _strdup
-#define strcasecmp _strcasecmp
+#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define strnicmp _strnicmp
#define ftruncate _chsize
@@ -83,6 +82,11 @@ static inline double log(int x)
return log((double)x);
}
+static inline double log2(double n)
+{
+ return log(n) / log(2.0);
+}
+
//this is targetting for struct member name in store.h, nothing else gets affected as of 0.9.0
#define _int64 var_int64