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
This commit is contained in:
Keir Mierle
2012-06-24 22:25:28 -07:00
parent 517e196ca8
commit efe7ac60a0
36 changed files with 188 additions and 61 deletions
+8 -2
View File
@@ -69,6 +69,12 @@ namespace internal {
// 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 @@ class FixedArray {
// 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_)