aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/Limits.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 22:03:58 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 22:08:56 +0200
commit4817437d31ab5f3c9969b8cc228e2f1826a0fbc2 (patch)
tree63ccba6966ce55e4eec40e354e0560b406eb9483 /src/fs/Limits.hxx
parent354b5a9365638068e746ca8b008171cbfe804c8a (diff)
downloadmpd-4817437d31ab5f3c9969b8cc228e2f1826a0fbc2.tar.gz
mpd-4817437d31ab5f3c9969b8cc228e2f1826a0fbc2.tar.xz
mpd-4817437d31ab5f3c9969b8cc228e2f1826a0fbc2.zip
fs/Limits: convert macro to "constexpr"
Diffstat (limited to 'src/fs/Limits.hxx')
-rw-r--r--src/fs/Limits.hxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/fs/Limits.hxx b/src/fs/Limits.hxx
index bf75f5135..480b08851 100644
--- a/src/fs/Limits.hxx
+++ b/src/fs/Limits.hxx
@@ -22,18 +22,17 @@
#include "check.h"
+#include <stddef.h>
#include <limits.h>
-#if !defined(MPD_PATH_MAX)
-# if defined(WIN32)
-# define MPD_PATH_MAX 260
-# elif defined(MAXPATHLEN)
-# define MPD_PATH_MAX MAXPATHLEN
-# elif defined(PATH_MAX)
-# define MPD_PATH_MAX PATH_MAX
-# else
-# define MPD_PATH_MAX 256
-# endif
+#if defined(WIN32)
+static constexpr size_t MPD_PATH_MAX = 260;
+#elif defined(MAXPATHLEN)
+static constexpr size_t MPD_PATH_MAX = MAXPATHLEN;
+#elif defined(PATH_MAX)
+static constexpr size_t MPD_PATH_MAX = PATH_MAX;
+#else
+static constexpr size_t MPD_PATH_MAX = 256;
#endif
#endif