STXXL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
msvc_compatibility.h
Go to the documentation of this file.
1 /***************************************************************************
2  * include/stxxl/bits/msvc_compatibility.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2009, 2011 Andreas Beckmann <[email protected]>
7  *
8  * Distributed under the Boost Software License, Version 1.0.
9  * (See accompanying file LICENSE_1_0.txt or copy at
10  * http://www.boost.org/LICENSE_1_0.txt)
11  **************************************************************************/
12 
13 #ifndef STXXL_MSVC_COMPATIBILITY_HEADER
14 #define STXXL_MSVC_COMPATIBILITY_HEADER
15 
16 #include <stxxl/bits/config.h>
17 
18 #if STXXL_MSVC
19 
20 #include <cmath>
21 
22 inline double log2(double x)
23 {
24  return (log(x) / log(2.));
25 }
26 
27 // http://msdn.microsoft.com/en-us/library/2ts7cx93.aspx
28 #define snprintf _snprintf
29 
30 // http://msdn.microsoft.com/en-us/library/h80404d3.aspx
31 #define strtoll _strtoi64
32 
33 // http://msdn.microsoft.com/en-us/library/85zk715d.aspx
34 #define strtoull _strtoui64
35 
36 #endif // STXXL_MSVC
37 
38 #endif // !STXXL_MSVC_COMPATIBILITY_HEADER
39 // vim: et:ts=4:sw=4