From 39c96694454822ade1d3a686f6e29bd52fa5a4d1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 5 Mar 2015 08:02:07 +0100 Subject: fs/Traits: add macro PATH_LITERAL() --- src/fs/FileSystem.hxx | 4 ++-- src/fs/Traits.hxx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/fs') diff --git a/src/fs/FileSystem.hxx b/src/fs/FileSystem.hxx index dcaca7c34..ac4e0998d 100644 --- a/src/fs/FileSystem.hxx +++ b/src/fs/FileSystem.hxx @@ -41,12 +41,12 @@ namespace FOpenMode { /** * Open mode for writing text files. */ - constexpr PathTraitsFS::const_pointer WriteText = "w"; + constexpr PathTraitsFS::const_pointer WriteText = PATH_LITERAL("w"); /** * Open mode for appending text files. */ - constexpr PathTraitsFS::const_pointer AppendText = "a"; + constexpr PathTraitsFS::const_pointer AppendText = PATH_LITERAL("a"); } /** diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx index 1a2cd8226..b557dd752 100644 --- a/src/fs/Traits.hxx +++ b/src/fs/Traits.hxx @@ -32,6 +32,8 @@ #include +#define PATH_LITERAL(s) (s) + /** * This class describes the nature of a native filesystem path. */ @@ -48,7 +50,7 @@ struct PathTraitsFS { static constexpr value_type SEPARATOR = '/'; #endif - static constexpr const_pointer CURRENT_DIRECTORY = "."; + static constexpr const_pointer CURRENT_DIRECTORY = PATH_LITERAL("."); static constexpr bool IsSeparator(value_type ch) { return -- cgit v1.2.3