diff --git a/src/fs/StandardDirectory.cxx b/src/fs/StandardDirectory.cxx
index 65d6b7a1c..18a3a942e 100644
--- a/src/fs/StandardDirectory.cxx
+++ b/src/fs/StandardDirectory.cxx
@@ -18,14 +18,9 @@
  */
 
 #include "config.h"
-
-// Use X Desktop guidelines where applicable
-#if !defined(__APPLE__) && !defined(_WIN32) && !defined(ANDROID)
-#define USE_XDG
-#endif
-
 #include "StandardDirectory.hxx"
 #include "FileSystem.hxx"
+#include "XDG.hxx"
 
 #include <array>
 
diff --git a/src/fs/StandardDirectory.hxx b/src/fs/StandardDirectory.hxx
index 2742c6f50..f8bcd504c 100644
--- a/src/fs/StandardDirectory.hxx
+++ b/src/fs/StandardDirectory.hxx
@@ -16,7 +16,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
- 
+
 #ifndef MPD_FS_STANDARD_DIRECTORY_HXX
 #define MPD_FS_STANDARD_DIRECTORY_HXX
 
diff --git a/src/fs/XDG.hxx b/src/fs/XDG.hxx
new file mode 100644
index 000000000..2569467f1
--- /dev/null
+++ b/src/fs/XDG.hxx
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2003-2018 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef MPD_FS_XDG_HXX
+#define MPD_FS_XDG_HXX
+
+// Use X Desktop guidelines where applicable
+#if !defined(__APPLE__) && !defined(_WIN32) && !defined(ANDROID)
+#define USE_XDG
+#endif
+
+#endif