diff --git a/tensorflow/core/util/memmapped_file_system.cc b/tensorflow/core/util/memmapped_file_system.cc index b3ca943c903..a07c1fbb7be 100644 --- a/tensorflow/core/util/memmapped_file_system.cc +++ b/tensorflow/core/util/memmapped_file_system.cc @@ -190,13 +190,8 @@ const void* MemmappedFileSystem::GetMemoryWithOffset(uint64 offset) const { return reinterpret_cast<const uint8*>(mapped_memory_->data()) + offset; } -#if defined(_MSC_VER) -constexpr char* MemmappedFileSystem::kMemmappedPackagePrefix; -constexpr char* MemmappedFileSystem::kMemmappedPackageDefaultGraphDef; -#else -constexpr char MemmappedFileSystem::kMemmappedPackagePrefix[]; -constexpr char MemmappedFileSystem::kMemmappedPackageDefaultGraphDef[]; -#endif +constexpr const char MemmappedFileSystem::kMemmappedPackagePrefix[]; +constexpr const char MemmappedFileSystem::kMemmappedPackageDefaultGraphDef[]; Status MemmappedFileSystem::InitializeFromFile(Env* env, const string& filename) { diff --git a/tensorflow/core/util/memmapped_file_system.h b/tensorflow/core/util/memmapped_file_system.h index 958e23d28e5..fea11a8351e 100644 --- a/tensorflow/core/util/memmapped_file_system.h +++ b/tensorflow/core/util/memmapped_file_system.h @@ -53,19 +53,11 @@ class MemmappedFileSystem : public FileSystem { public: // Memmapped regions use this prefix to distinguish from // the filesystem. -#if defined(_MSC_VER) - static constexpr char* kMemmappedPackagePrefix = -#else - static constexpr char kMemmappedPackagePrefix[] = -#endif + static constexpr const char kMemmappedPackagePrefix[] = "memmapped_package://"; -// The default graphdef in the package. -#if defined(_MSC_VER) - static constexpr char* kMemmappedPackageDefaultGraphDef = -#else - static constexpr char kMemmappedPackageDefaultGraphDef[] = -#endif + // The default graphdef in the package. + static constexpr const char kMemmappedPackageDefaultGraphDef[] = "memmapped_package://."; MemmappedFileSystem();