Better workaround for MSVC 14.0 limitation related to constexpr array.
PiperOrigin-RevId: 258793545
This commit is contained in:
parent
f6e0ec468a
commit
6ab65bc0c9
@ -190,13 +190,8 @@ const void* MemmappedFileSystem::GetMemoryWithOffset(uint64 offset) const {
|
|||||||
return reinterpret_cast<const uint8*>(mapped_memory_->data()) + offset;
|
return reinterpret_cast<const uint8*>(mapped_memory_->data()) + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
constexpr const char MemmappedFileSystem::kMemmappedPackagePrefix[];
|
||||||
constexpr char* MemmappedFileSystem::kMemmappedPackagePrefix;
|
constexpr const char MemmappedFileSystem::kMemmappedPackageDefaultGraphDef[];
|
||||||
constexpr char* MemmappedFileSystem::kMemmappedPackageDefaultGraphDef;
|
|
||||||
#else
|
|
||||||
constexpr char MemmappedFileSystem::kMemmappedPackagePrefix[];
|
|
||||||
constexpr char MemmappedFileSystem::kMemmappedPackageDefaultGraphDef[];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Status MemmappedFileSystem::InitializeFromFile(Env* env,
|
Status MemmappedFileSystem::InitializeFromFile(Env* env,
|
||||||
const string& filename) {
|
const string& filename) {
|
||||||
|
|||||||
@ -53,19 +53,11 @@ class MemmappedFileSystem : public FileSystem {
|
|||||||
public:
|
public:
|
||||||
// Memmapped regions use this prefix to distinguish from
|
// Memmapped regions use this prefix to distinguish from
|
||||||
// the filesystem.
|
// the filesystem.
|
||||||
#if defined(_MSC_VER)
|
static constexpr const char kMemmappedPackagePrefix[] =
|
||||||
static constexpr char* kMemmappedPackagePrefix =
|
|
||||||
#else
|
|
||||||
static constexpr char kMemmappedPackagePrefix[] =
|
|
||||||
#endif
|
|
||||||
"memmapped_package://";
|
"memmapped_package://";
|
||||||
|
|
||||||
// The default graphdef in the package.
|
// The default graphdef in the package.
|
||||||
#if defined(_MSC_VER)
|
static constexpr const char kMemmappedPackageDefaultGraphDef[] =
|
||||||
static constexpr char* kMemmappedPackageDefaultGraphDef =
|
|
||||||
#else
|
|
||||||
static constexpr char kMemmappedPackageDefaultGraphDef[] =
|
|
||||||
#endif
|
|
||||||
"memmapped_package://.";
|
"memmapped_package://.";
|
||||||
|
|
||||||
MemmappedFileSystem();
|
MemmappedFileSystem();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user