mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 09:00:37 +08:00
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:
@@ -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_)
|
||||
|
||||
Reference in New Issue
Block a user