]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/type.h
Don't use long long on MSVC
[libs/datafile.git] / source / type.h
index 5a87a10222a84794341d9a167c94786ae022927f..a7c57c40d230b55e15dc1d5313039e1d39cf347a 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspdatafile
-Copyright © 2010  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_DATAFILE_TYPE_H_
 #define MSP_DATAFILE_TYPE_H_
 
@@ -17,7 +10,8 @@ struct Symbol
 {
        std::string name;
 
-       Symbol(const std::string &n): name(n) { }
+       template<typename T>
+       Symbol(const T &n): name(lexical_cast(n)) { }
 
        template<typename T> operator T() const { return lexical_cast<T>(name); }
 };
@@ -25,7 +19,12 @@ struct Symbol
 struct IntType
 {
        static const char signature = 'i';
+#ifdef MSVC
+       typedef __int64 Store;
+#else
        typedef long long int Store;
+#endif
+       typedef Store Load;
 };
 
 struct FloatType
@@ -74,11 +73,19 @@ struct TypeInfo<long int>: IntType { };
 template<>
 struct TypeInfo<unsigned long int>: IntType { };
 
+#ifdef MSVC
+template<>
+struct TypeInfo<__int64>: IntType { };
+
+template<>
+struct TypeInfo<unsigned __int64>: IntType { };
+#else
 template<>
 struct TypeInfo<long long int>: IntType { };
 
 template<>
 struct TypeInfo<unsigned long long int>: IntType { };
+#endif
 
 template<>
 struct TypeInfo<float>: FloatType { };