Port Ceres to Windows
This is a preliminary, but full, port of Ceres to Windows.
Currently all tests compile and run, with only system_test
failing to work correctly due to a path issue.
Change-Id: I4152c1588bf51ffd7f4d9401ef9759f5d28c299c
diff --git a/include/ceres/internal/fixed_array.h b/include/ceres/internal/fixed_array.h
index aa1722c..e11b71b 100644
--- a/include/ceres/internal/fixed_array.h
+++ b/include/ceres/internal/fixed_array.h
@@ -69,6 +69,12 @@
// Non-POD types will be default-initialized just like regular vectors or
// arrays.
+#if defined(_WIN64)
+ typedef __int64 ssize_t;
+#elif defined(_WIN32)
+ typedef __int32 ssize_t;
+#endif
+
template <typename T, ssize_t inline_elements = -1>
class FixedArray {
public:
@@ -152,13 +158,13 @@
// Allocate some space, not an array of elements of type T, so that we can
// skip calling the T constructors and destructors for space we never use.
- ManualConstructor<InnerContainer> inline_space_[kInlineElements] CERES_ALIGN_ATTRIBUTE(16);
+ ManualConstructor<InnerContainer> CERES_ALIGN_ATTRIBUTE(16) inline_space_[kInlineElements];
};
// Implementation details follow
template <class T, ssize_t S>
-inline FixedArray<T, S>::FixedArray(FixedArray<T, S>::size_type n)
+inline FixedArray<T, S>::FixedArray(typename FixedArray<T, S>::size_type n)
: size_(n),
array_((n <= kInlineElements
? reinterpret_cast<InnerContainer*>(inline_space_)